How ganeshedula/capstone works
This repository is a DoLa + ENN hallucination-reduction and evaluation pipeline for TinyLlama. Its principal workflow is CLI invocation, model loading, C4 feature preparation, ENN training, then model evaluation and comparison plots; it also offers inference and DoLa experiments. The source index identifies substantial modules and some references, but the README is empty and excerpts omit key orchestration and subsystem internals. Accordingly, uncertain main.py dispatches are shown as unverified rather than asserted.
Main entry points: main.py CLI pipeline · enn_torch.py Torch Epinet · before_after_eval.py Before/after evaluation · c4_eval.py C4 token evaluation
Components 14
Pipeline entry
- CLI pipeline
main.py
Model and decoding
- TinyLlama loader
Model_load/load_llama2.py - DoLa contrastive decoding
Neural Network/dola.py - Autoregressive inference
Neural Network/inference.py
ENN preparation and training
- C4 feature preparation
Neural Network/data_prep.py - Torch Epinet
Neural Network/enn_torch.py - JAX ENN
Neural Network/enn_jax.py
Evaluation and analysis
- TruthfulQA evaluation
Neural Network/evaluate.py - Before/after evaluation
Neural Network/before_after_eval.py - Before/after plots
Neural Network/before_after_plots.py - C4 token evaluation
Neural Network/c4_eval.py - C4 evaluation plots
Neural Network/c4_eval_plots.py
Other components
- C4 text source
- CLI user
Connections 24
- CLI user → CLI pipeline: invokes
main.py - CLI pipeline → TinyLlama loader: loads model
main.py - CLI pipeline → C4 feature preparation: prepares features
main.py - CLI pipeline → Torch Epinet: trains ENN
main.py - CLI pipeline → TruthfulQA evaluation: runs evaluation
main.py - CLI pipeline → Before/after evaluation: runs comparison
main.py - CLI pipeline → Before/after plots: generates plots
main.py - CLI pipeline → C4 token evaluation: runs C4 evaluation
main.py - CLI pipeline → C4 evaluation plots: generates plots
main.py - C4 text source → C4 feature preparation: provides text
Neural Network/data_prep.py - C4 text source → C4 token evaluation: provides held-out text
- C4 feature preparation → DoLa contrastive decoding: extracts hidden states
Neural Network/data_prep.py - C4 feature preparation → Torch Epinet: produces training features
- TruthfulQA evaluation → DoLa contrastive decoding: scores with DoLa
Neural Network/evaluate.py - TruthfulQA evaluation → Torch Epinet: uses ENN logits
Neural Network/evaluate.py - Before/after evaluation → TruthfulQA evaluation: reuses scoring
Neural Network/before_after_eval.py - Before/after evaluation → DoLa contrastive decoding: evaluates DoLa
Neural Network/before_after_eval.py - Before/after evaluation → Torch Epinet: evaluates DoLa plus ENN
Neural Network/before_after_eval.py - Before/after plots → Before/after evaluation: plots results
Neural Network/before_after_plots.py - C4 token evaluation → DoLa contrastive decoding: scores tokens
Neural Network/c4_eval.py - C4 token evaluation → Torch Epinet: scores with ENN
Neural Network/c4_eval.py - C4 evaluation plots → C4 token evaluation: plots results
Neural Network/c4_eval_plots.py - Autoregressive inference → DoLa contrastive decoding: gets contrastive logits
Neural Network/inference.py - Autoregressive inference → Torch Epinet: gets ENN predictions
Neural Network/inference.py