Technical Report | GitHub | GGUF
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.
| 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.
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.
[!TIP] 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 qwen3to return the reasoning separately from the JSON.
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"])
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."
}
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.
occ-ai/OCC-RAG-2B-GGUF Magnet 1occ-ai/Qwen3.5-2B-Unloop