Optimal Cognitive Core

Technical Report  |  GitHub  |  GGUF

OCC-RAG-2B

OCC-RAG-2B is a 2B-parameter language model in the Optimal Cognitive Core (OCC) family, specialized for faithful question answering over retrieved documents. Given a question and a set of passages, it reasons across the sources and decides whether they contain enough evidence to answer. It returns its answer in JSON with citations to the supporting passages, or an explicit UNANSWERABLE status when a necessary fact is missing.

With 2B parameters, OCC-RAG-2B outperforms Qwen3.5-4B and Qwen3.5-9B on average across seven tasks spanning multi-hop reasoning, financial question answering, and faithfulness to the supplied context. It is competitive with Qwen3.8-27B, a model over 13 times its size, and ranks first among the models compared on TAT-QA, the ConvFinQA subset of Tยฒ-RAGBench, and the single-hop split of ConFiQA.

We used OCCโ€™s Qwen3.5-2B-Unloop as our base model.

Highlights

  • Faithful by design โ€” Trained to follow the supplied passages even when they contradict a fact the model learned during pretraining.
  • Answers with citations โ€” The JSON response includes a short answer, a fuller explanation and source IDs your application can link back to the original passages.
  • Fewer output tokens โ€” Across the seven benchmark tasks, OCC-RAG-2B generates 468 tokens per response on average, 89% fewer than Qwen3.5-2B in thinking mode (4,281).

Evaluation

Benchmark OCC-RAG
2B
Qwen3.5
2B
Qwen3.5
4B
Qwen3.5
9B
Qwen3.8
27B
Qwen3.6
35B-A3B
Multi-hop reasoning
MuSiQue ยท answerable
Answer from evidence
52.9 41.0 55.2 54.0 62.7 64.3
Faithfulness to context
ConFiQA ยท QA
Single-hop QA, one counterfactual
71.0 67.7 65.1 65.6 70.4 67.9
ConFiQA ยท MR
Multi-hop QA, one counterfactual
60.6 52.3 53.6 54.7 63.6 60.8
ConFiQA ยท MC
Multi-hop QA, multiple counterfactuals
58.2 48.9 52.1 53.6 62.6 61.4
Financial question answering
Tยฒ-RAGBench ยท FinQA
Numerical QA ยท test split
65.2 55.3 63.9 63.9 65.5 65.1
Tยฒ-RAGBench ยท ConvFinQA
First question from each dialogue
84.2 76.9 80.5 80.6 82.6 82.1
TAT-QA
Table and text reading
64.5 51.7 57.1 57.5 54.9 56.5
Overall
Average score
7 equally weighted rows
65.2 56.2 61.1 61.4 66.1 65.4
Average reasoning and answer length
Tokens per response
468 4,281 3,039 3,208 919 1,760

MuSiQue uses inclusion accuracy and ConFiQA uses exact match, both over all questions including refusals. For the FinQA and ConvFinQA subsets of Tยฒ-RAGBench, we supply the gold report page and use an LLM judge to score the answer. TAT-QA uses official F1. Scores are percentages.

Quickstart

Pass the question as plain text and the retrieved passages as documents, a list of dictionaries with a text field. The chat template numbers documents in the order supplied, so source ID 2 refers to documents[1]. Pass the documents with the final user message.

Both examples load the weights, tokenizer and document-aware chat template from this repository.

Recommended sampling parameters

OCC-RAG-2B supports thinking mode only. The supplied chat template opens <think> automatically; the model continues the reasoning, closes it with </think>, and then generates the final JSON answer.

Use greedy decoding, as in our benchmark runs.

  • Transformers: do_sample=False
  • vLLM: temperature=0.0. Start the server with --reasoning-parser qwen3 to return the reasoning separately from the JSON.

Transformers

Load the model and pass the question and documents directly to the tokenizer.

import json

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_path = "occ-ai/OCC-RAG-2B"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForImageTextToText.from_pretrained(
    model_path, dtype="auto", device_map="auto"
).eval()

messages = [{"role": "user", "content": "In which year did the archive open to the public?"}]
documents = [
    {"text": "The archive was founded in 1987 as a private collection."},
    {"text": "The archive opened its doors to the public in 1994."},
]
inputs = tokenizer.apply_chat_template(
    messages, documents=documents, add_generation_prompt=True,
    tokenize=True, return_dict=True, return_tensors="pt",
).to(model.device)
with torch.inference_mode():
    output = model.generate(**inputs, max_new_tokens=8192, do_sample=False, use_cache=True)

tokens = output[0, inputs.input_ids.shape[1]:].tolist()
if tokenizer.eos_token_id in tokens:
    tokens = tokens[:tokens.index(tokenizer.eos_token_id)]
completion = tokenizer.decode(tokens, skip_special_tokens=False)
answer = json.loads(completion.rsplit("</think>", 1)[-1].strip())
print(answer["answer"], answer["sources"])

vLLM

Start the server with the Qwen reasoning parser to separate the reasoning block from the final JSON.

vllm serve occ-ai/OCC-RAG-2B --reasoning-parser qwen3

Send documents as a request field and use response_format to constrain the final answer to the schema. vLLM structured outputs

from typing import Literal

from openai import OpenAI
from pydantic import BaseModel

class Answer(BaseModel):
    status: Literal["ANSWERABLE", "UNANSWERABLE"]
    sources: list[int]
    answer: str
    full_answer: str

question = "In which year did the archive open to the public?"
documents = [
    {"text": "The archive was founded in 1987 as a private collection."},
    {"text": "The archive opened its doors to the public in 1994."},
]

client = OpenAI(base_url="http://localhost:8000/v1", api_key="local")
response = client.chat.completions.create(
    model="occ-ai/OCC-RAG-2B",
    messages=[{"role": "user", "content": question}],
    extra_body={"documents": documents},
    response_format={
        "type": "json_schema",
        "json_schema": {"name": "answer", "schema": Answer.model_json_schema()},
    },
    temperature=0.0,
    max_tokens=8192,
)
choice = response.choices[0]
if choice.finish_reason != "stop" or not choice.message.content:
    raise ValueError("Incomplete answer")
result = Answer.model_validate_json(choice.message.content)
print(result.model_dump())

Example JSON response:

{
  "status": "ANSWERABLE",
  "sources": [2],
  "answer": "1994",
  "full_answer": "The archive opened to the public in 1994."
}

License

OCC-RAG-2B is released under the Apache 2.0 License. Its base model, Qwen3.5-2B-Unloop, is also licensed under Apache 2.0.

Downloads last month
346
Safetensors
Model size
2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for occ-ai/OCC-RAG-2B

Finetuned
Qwen/Qwen3.5-2B
Finetuned
(1)
this model
Quantizations
2 models

Collection including occ-ai/OCC-RAG-2B