Llama-3.1-8B-CIRF-Full

Built with Llama. The manually trained full-result Stage I model.

This is a standalone BF16 CIRF model derived from Meta Llama 3.1 8B. LoRA updates are merged into the dense parameters. All 514 trained new-token input and output rows are included: [sof], [eof], and 512 functional tokens [f_0] through [f_511]. Inference requires neither a PEFT adapter nor the original base-model files, a CIRF checkout, a teacher model, or a VQ encoder.

Checkpoint and training

  • Source manual checkpoint: functional-llama3.1-8b.
  • Parameters after merging: 8,034,471,936; vocabulary: 128,770 tokens.
  • LoRA rank / alpha: 64 / 128; dropout: 0.05.
  • Stage I: 2 epochs; LoRA LR 0.0002; new-token LR 7e-05; batch size 32; gradient accumulation 1.
  • Maximum training length: 768; seed: 0; validation fraction: 0.05.
  • Exact settings, source hashes and export checks are saved in training_config.json, provenance.json, and export_verification.json.

These are the manually trained model family, rather than hyperparameter-search checkpoints:

Prompt format

Use exactly one Llama BOS token, followed by the raw question and [sof]:

<|begin_of_text|>QUESTION[sof]

No chat template is used. The model generates functional codes and optional result values, then [eof] and the final answer. Stop on the tokenizer's normal EOS token, not [eof], because the answer follows that delimiter. Decode with skip_special_tokens=False to retain these boundaries.

The 18/6-token budgets constrain explicit result values in training targets. They do not prune model weights, cap functional-token count, or impose an inference-time limit on total generated tokens. Backward greedy can remove additional nonpositive-loss result units after meeting the budget.

Quick start

pip install torch transformers accelerate safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo_id = "JhCIFT/Llama-3.1-8B-CIRF-Full"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(
    repo_id, dtype=torch.bfloat16, device_map="auto"
)
model.eval()
prompt = tokenizer.bos_token + "What is 2 + 2?[sof]"
inputs = tokenizer(prompt, add_special_tokens=False, return_tensors="pt").to(model.device)
with torch.inference_mode():
    output = model.generate(
        **inputs, max_new_tokens=384, do_sample=False,
        eos_token_id=tokenizer.eos_token_id,
        pad_token_id=tokenizer.pad_token_id,
    )
ids = output[0, inputs.input_ids.shape[1]:].tolist()
if tokenizer.eos_token_id in ids:
    ids = ids[:ids.index(tokenizer.eos_token_id)]
trace = tokenizer.decode(ids, skip_special_tokens=False)
answer = trace.split("[eof]", 1)[1].strip() if "[eof]" in trace else None
print(trace)
print(answer)

To apply the CIRF evaluation limit of at most 32 generated functional codes, download the included inference.py and run:

python inference.py --model JhCIFT/Llama-3.1-8B-CIRF-Full --question "What is 2 + 2?"

This standalone script preserves the BOS convention and masks further functional codes once the cap is reached, while allowing results and the final answer. Export and standalone reload were verified with Transformers 5.17.0.

Saved internal validation results

These results are copied from the checkpoint's existing 1068-example internal validation evaluation. They were not rerun during publication and are not independent official benchmark test results. Do not attribute search-checkpoint scores or later test evaluations to this table.

Source Examples Answer accuracy
coinflip 251 100.00%
commonsenseqa 396 83.08%
gsm8k 367 59.40%
multiarith 20 100.00%
svamp 34 85.29%
  • Equal-weight source macro accuracy: 85.55%.
  • Example-weighted accuracy: 79.31%.
  • Mean generated length: 24.60 tokens.

The training mixture contains coin-flip, CommonsenseQA, GSM8K, MultiArith and SVAMP. This model is specialized for CIRF-formatted reasoning. Generalization to longer sequences or other tasks requires separate evaluation.

Export integrity

The LoRA weights were safely merged on CPU, serialized as safetensors, and loaded with AutoModelForCausalLM without adapters. Learned new-token input/output rows were preserved exactly, and reloaded logits exactly matched the in-memory merged model on two probe prefixes, each containing exactly one BOS token. A short standalone generation is recorded in export_verification.json. No adapter tensors remain. These are export checks, not a new benchmark evaluation. checksums.json lists SHA-256 hashes of the release files.

License and attribution

This derivative is distributed under the Llama 3.1 Community License. The original agreement, attribution and acceptable-use policy are included in LICENSE, NOTICE, and USE_POLICY.md. Built with Llama.

Changes comprise CIRF functional vocabulary expansion, learned input/output rows, supervised adaptation, and merging the LoRA updates into the base parameters.

Downloads last month
50
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for JhCIFT/Llama-3.1-8B-CIRF-Full

Finetuned
(1506)
this model