eulogik / Prajna-CRNv2

huggingface.co
Total runs: 395
24-hour runs: 0
7-day runs: 6
30-day runs: 207
Model's Last Updated: October 01 2026
text-generation

Introduction of Prajna-CRNv2

Model Details of Prajna-CRNv2

🪷 Prajna-CRNv2 — Safe Error Correction for Language Models

GitHub HF downloads Correction Degradation Base Hardware

Fix a frozen model's errors without breaking what it already does well.

Prajna-CRNv2 is a tiny correction module (34M params, 0.73% of the base) that sits on top of a fully frozen Gemma-4-E2B and learns to adjust its logits where it detects errors. The base model is never updated — not one gradient, not one weight. What you get is error correction with zero measurable capability loss , trained end-to-end on a Mac Mini M4.

corrected_logits = base_logits + gate * up(gelu(down(hidden)))

Built by eulogik · Code + paper: github.com/eulogik/prajna

✨ Why it matters

Fine-tuning fixes errors but causes forgetting — the correction–capability tradeoff . A LoRA baseline on the same exam corrects more (83.3%) yet destroys 30–75% of base capabilities (MMLU 62.5% → 32%, car-wash 75% → 0%). Prajna-CRNv2 corrects 53.3% while matching the frozen base exactly on every tested benchmark. For deployment, a model that fixes some errors and stays reliable beats one that fixes more and breaks reasoning.

🏆 Results
CEHRI Original (60) CEHRI Reworded (120) MMLU (200) BoolQ (200) Car-wash (8)
Frozen base 11.7% — 62.5% 72.0% 75.0%
Prajna-CRNv2 53.3% 43.3% 62.5% (Δ=0) 72.0% (Δ=0) 75.0% (Δ=0)
LoRA baseline (6.6M) 83.3% 77.5% 32.0% (−30.5pp) 55.0% (−17pp) 0% (−75pp)

A hidden-state injection sweep (1.6M-param variant at layers 4/7) confirms ~53% as the ceiling for frozen-base methods — deeper injection helps (30% → 50%) but never beats logit correction. See the paper for the full story, including ablations and limitations.

Correction: CRN v2 vs LoRA vs frozen base Capability preservation: CRN v2 matches base, LoRA collapses

Injection-depth sweep (experimental)
Variant Training CEHRI Original CEHRI Reworded Capability
Deep layer 4 (1.6M) SFT-only 30.0% 28.3% not probed
Deep layer 7 (1.6M) SFT-only 50.0% 55.8% intact (small probe)
Deep layer 7 (1.6M) SFT + DPO 50.0% 55.0% destroyed (MMLU 13%)
Logit CRN v2 (34M) SFT + DPO 53.3% 43.3% intact

Injection-depth sweep

🚀 Quickstart
pip install torch transformers
import torch, sys
sys.path.insert(0, ".")  # for crn_v2.py
from crn_v2 import CRNv2

model = CRNv2(device="mps" if torch.backends.mps.is_available() else "cpu")
model.load("crn_v2_dpo.pt")  # 34M correction weights (this repo)

print(model.generate("What is the capital of France?"))
# Or correct a draft answer:
print(model.correct("What is 2+2?", "5"))

Or use the interactive demo:

python inference.py
python inference.py --prompt "What is 2+2?" --draft "5"

Requirements: Python 3.10+, PyTorch 2.0+, ~10GB RAM (Gemma-4-E2B loads in float16; set HF_HOME to an external disk if space is tight).

📁 Files
File Size Purpose
crn_v2_dpo.pt 130 MB Trained correction weights (rank-128, SFT+DPO, KL λ=0.1)
crn_v2.py — Architecture ( LogitCorrection + CRNv2 )
crn_deep.py — Experimental hidden-state injection variant (code only)
inference.py — Interactive demo / single-shot correction
config.json — Model + training metadata
🔬 Training
  • Stage 1 — SFT (2,000 steps): anchor-weighted answer-only CE (anchor 4×, EOS 5×) + KL preservation (λ=0.1) on 83,400 error-correction pairs. AdamW, LR 3e-4, cosine decay.
  • Stage 2 — DPO (500 steps): reference-free preference of the correct answer over the frozen base's wrong answer (β=0.1, LR 5e-6).
  • Hardware: Apple M4, 16GB, MPS — ~25 min end-to-end. Base frozen throughout.
🤔 FAQ

Is the base model modified? No. Every base parameter is frozen; only the 34M correction module trains.

Why 53.3% and not higher? Frozen-base correction has a real ceiling (~53% here) — closing the gap to weight-modifying methods costs capabilities. We publish the boundary as carefully as the headline; see Limitations in the paper.

Does it generalize? The exam prompts appear verbatim in training (in-distribution: 53.3%); the reworded exam measures near-duplicate correction (43.3%). Neither tests out-of-distribution generalization — stated openly.

Can I retrain it? Yes — full pipeline (data, SFT+DPO trainers, evals) in the GitHub repo .

📜 License

Weights + code released under Gemma terms (as required by the base model). Research use. See the paper for methods, ablations, and limitations.

🪷 Prajna — "wisdom": fix errors, keep knowledge.

Runs of eulogik Prajna-CRNv2 on huggingface.co

395
Total runs
0
24-hour runs
2
3-day runs
6
7-day runs
207
30-day runs

More Information About Prajna-CRNv2 huggingface.co Model

More Prajna-CRNv2 license Visit here:

https://choosealicense.com/licenses/gemma

Prajna-CRNv2 huggingface.co

Prajna-CRNv2 huggingface.co is an AI model on huggingface.co that provides Prajna-CRNv2's model effect (), which can be used instantly with this eulogik Prajna-CRNv2 model. huggingface.co supports a free trial of the Prajna-CRNv2 model, and also provides paid use of the Prajna-CRNv2. Support call Prajna-CRNv2 model through api, including Node.js, Python, http.

Prajna-CRNv2 huggingface.co Url

https://huggingface.co/eulogik/Prajna-CRNv2

eulogik Prajna-CRNv2 online free

Prajna-CRNv2 huggingface.co is an online trial and call api platform, which integrates Prajna-CRNv2's modeling effects, including api services, and provides a free online trial of Prajna-CRNv2, you can try Prajna-CRNv2 online for free by clicking the link below.

eulogik Prajna-CRNv2 online free url in huggingface.co:

https://huggingface.co/eulogik/Prajna-CRNv2

Prajna-CRNv2 install

Prajna-CRNv2 is an open source model from GitHub that offers a free installation service, and any user can find Prajna-CRNv2 on GitHub to install. At the same time, huggingface.co provides the effect of Prajna-CRNv2 install, users can directly use Prajna-CRNv2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Prajna-CRNv2 install url in huggingface.co:

https://huggingface.co/eulogik/Prajna-CRNv2

Url of Prajna-CRNv2

Prajna-CRNv2 huggingface.co Url

Provider of Prajna-CRNv2 huggingface.co

eulogik
ORGANIZATIONS

Other API from eulogik

huggingface.co

Total runs: 279
Run Growth: -107
Growth Rate: -38.35%
Updated:October 05 2026
huggingface.co

Total runs: 230
Run Growth: 177
Growth Rate: 76.96%
Updated:September 29 2026
huggingface.co

Total runs: 108
Run Growth: 96
Growth Rate: 88.89%
Updated:September 29 2026
huggingface.co

Total runs: 55
Run Growth: 29
Growth Rate: 52.73%
Updated:September 26 2026
huggingface.co

Total runs: 9
Run Growth: 9
Growth Rate: 100.00%
Updated:October 06 2026