Downloads ยท 30 days
16
5% of all-time downloads
amkkk/Trace-Inverter-4B-NoBubble
Trace-Inverter-4B-NoBubble is a machine learning model from amkkk. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Trace-Inverter-4B-NoBubble is a 4B-parameter trace inversion model trained to reconstruct a detailed synthetic reasoning trace from only an original problem and a known final answer. No reasoning bubble, summary, or cโฆ
Downloads ยท 30 days
16
5% of all-time downloads
All-time downloads
338
Public
Parameters
4B
8.1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors8 GB ยท 100%
From the Hugging Face model README
Trace-Inverter-4B-NoBubble is a 4B-parameter trace inversion model trained to reconstruct a detailed synthetic reasoning trace from only an original problem and a known final answer. No reasoning bubble, summary, or compressed CoT is required at inference time.
The training targets come from the inverted_reasoning / reconstructed-trace fields of Jackrong/Claude-opus-4.6-TraceInversion-9000x and Jackrong/Claude-opus-4.7-TraceInversion-5000x. Those traces were originally produced by a bubble-conditioned inversion pipeline. We strip the bubble out of the student's inputs entirely, which distils bubble-assisted trace reconstruction into a no-bubble model.
[!IMPORTANT] Core Disclaimer: the generated trace is a synthetic reconstruction. It is not the actual hidden reasoning of Claude or of any source model, and no output from this model should ever be presented as recovered Chain-of-Thought. Because the model is conditioned on a supplied final answer, it will happily construct a plausible-looking path to a wrong answer.
[!NOTE] ๐ Jackrong/Trace-Inverter-4B ๐ Claude-opus-4.6-TraceInversion-9000x ๐ Claude-opus-4.7-TraceInversion-5000x
Commercial reasoning models hide their full Chain-of-Thought and expose only a short summary โ a reasoning bubble. Trace inversion research asks whether an external model can expand those visible fragments back into a usable, detailed reasoning trace.
That framing assumes the bubble exists. It usually does not. Historical chat logs, support transcripts and most public datasets have a question and an answer and nothing in between. The interesting question for those is narrower: how much of the reconstruction survives when the bubble is removed from the input entirely?
<table> <tr> <td align="center" width="22%"><b>๐ง Base</b><br>Qwen3-4B-Instruct-2507<br><code>cdbee75fโฆ</code></td> <td align="center" width="4%">โก๏ธ</td> <td align="center" width="26%"><b>๐ Targets</b><br>Jackrong Claude 4.6 + 4.7<br>inversion traces<br><b>bubbles dropped</b></td> <td align="center" width="4%">โก๏ธ</td> <td align="center" width="20%"><b>๐งต LoRA BF16</b><br>r64 / ฮฑ128<br>1 epoch ยท seq 2048</td> <td align="center" width="4%">โก๏ธ</td> <td align="center" width="20%"><b>๐ซง This repo</b><br>merged 4B<br><code>I(x, y) โ tฬ</code></td> </tr> </table>This is distillation of bubble-assisted trace inversion into a no-bubble student inverter. The model learns to approximate bubble-informed reconstructions while receiving only the problem and the final answer.
[!WARNING] Consequently, the most appropriate positioning for this model is:
- ๐ซง reconstructing a
<think>trace when no reasoning bubble exists โ the common case in historical logs;- ๐ฌ research on the no-summary setting of trace inversion;
- ๐ measuring how much information the bubble actually carries, by differencing against a bubble-fed model;
- ๐ building synthetic reasoning-supervision data with mandatory downstream verification;
- โก removing the runtime compression model โ no separate summary-generation step, inference needs only
x + y.It is not a general-purpose chat model.
Jackrong/Trace-Inverter-4B is trained as I(x, y, b) โ tฬ and expects reasoning bubbles. Prompting it with an empty bubble is out of distribution; that is not how this student was trained, and it is not a fair use of that model.
Let x be the original problem or conversational context, y the known final answer, and tฬ the synthetic reconstructed reasoning. The mapping this model learns is:
$$I_{\text{no-bubble}}(x, y) \to \hat{t}$$
against the bubble-conditioned teacher formulation:
$$I(x, y, b) \to \hat{t}$$
Three conditions hold:
y is a destination the trace must reach. The model does not verify y and must not be read as endorsing it.<think>โฆ</think> block, trained in explicitly so downstream cleaning is mechanical.Inspired by the no-summary setting in Zhang, Morris and Shmatikov, How to Steal Reasoning Without Reasoning Traces (arXiv:2603.07267), written there as I_nosum(x, y) โ tฬ.
[!TIP] This is not an exact reproduction of the paper's no-summary experiment. Its target traces were originally generated by a bubble-conditioned inversion model, so bubble information is present in the supervision even though it is absent from the input.
Deviations from the paper: Qwen3-4B-Instruct-2507 instead of Qwen2.5-7B-Instruct; LoRA BF16 on a single consumer GPU instead of full fine-tuning on 8ร A100; Jackrong Claude inversion datasets instead of OpenThoughts/R1 surrogate traces; bubble-informed target provenance.
Conceptually the Jackrong dataset traces were created as:
Original Problem + Claude Final Answer + Claude Reasoning Bubble
โ
Bubble-conditioned Trace Inverter (Jackrong/Trace-Inverter-4B)
โ
inverted_reasoning
This student is trained as:
Original Problem + Claude Final Answer
โ
Trace-Inverter-4B-NoBubble
โ
inverted_reasoning
Qwen/Qwen3-4B-Instruct-2507, vanilla. Not initialised from Jackrong/Trace-Inverter-4B. Revision cdbee75f17c01a7cc42f958dc650907174af0554Jackrong/Claude-opus-4.6-TraceInversion-9000x @ dcb98612aa4eb657cddec26ac2047e3f6c454ed3Jackrong/Claude-opus-4.7-TraceInversion-5000x @ ab3b48f1d461ec40af924fd3163d2b9c8eaeb07cExact field mapping:
input / prompt โ original problem/context
output / final_answer โ known final-answer constraint
inverted_reasoning / reconstructed_trace โ supervised training target
reasoning_bubble / reasoning_bubbles โ DROPPED
messages / conversations / merged_response โ DROPPED
reasoning_bubble is physically removed from processed training records. Student prompts never inject Reasoning Bubble:, Reasoning Bubbles: or Reasoning Summary:.
| Quantity | Count |
|---|---|
| raw Claude 4.6 rows | 8669 |
| raw Claude 4.7 rows | 4761 |
| combined rows | 13430 |
| exact duplicate problem groups | 1247 |
| rows removed | 2 |
| final unique rows | 13428 |
Same problem + same answer + different traces: keep the longest target. Same problem + different answers: keep both, assigned to the same split via problem hash.
Seed 260307267. 90/5/5 by normalized problem hash. No hash appears in more than one split. Test was not used for training, checkpoint selection, or prompt engineering.
| Split | Rows |
|---|---|
| train | 12094 |
| validation | 667 |
| test | 667 |
Supervised causal LM fine-tuning: maximise p(target_trace | problem, final_answer) with teacher forcing and assistant-only loss. Full-parameter BF16 SFT does not fit on a single consumer GPU, so this release uses LoRA BF16 then merges the adapters into a standalone Transformers checkpoint.
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projwarmup_ratio=0.1adamw_torch, precision BF16Token-length statistics (training subsample) are in data/processed/manifest.json.
System โ no-bubble inversion instructions (see repository common.py).
User
Problem:
{problem}
Model's final answer:
{final_answer}
Reconstruct the detailed synthetic reasoning trace.
Assistant
<think>
{synthetic trace}
</think>
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "amkkk/Trace-Inverter-4B-NoBubble"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
messages = [
{
"role": "system",
"content": (
"You are a no-bubble trace inversion model. "
"Given an original problem or conversation context and a known "
"final answer, reconstruct a detailed synthetic reasoning trace "
"that could plausibly connect the original input to that answer. "
"No reasoning summary or reasoning bubbles are available. "
"The result is a synthetic reconstruction and must not be "
"interpreted as the actual hidden reasoning of the source model. "
"Output only the reconstructed trace wrapped in <think> and </think>."
),
},
{
"role": "user",
"content": """Problem:
{problem}
Model's final answer:
{final_answer}
Reconstruct the detailed synthetic reasoning trace."""
},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=8192, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=False))
[!TIP] Post-processing before any generated trace enters a training set:
- Check the output is fully enclosed in
<think>โฆ</think>;- Verify the trace is consistent with the supplied final answer;
- Use symbolic computation or rule-based checks for maths;
- Use unit tests or execution for code;
- Drop samples with hallucinations, repetition, off-topic content or heavy templating;
- Deduplicate and length-filter;
- Sample and manually inspect reasoning quality.
Teacher-style sibling: ๐ Jackrong/Trace-Inverter-4B. Training targets: ๐ Claude-opus-4.6-TraceInversion-9000x ยท ๐ Claude-opus-4.7-TraceInversion-5000x.
Four systems, deterministic decoding (do_sample=False), held-out public-10 selected by sorting test samples on SHA256(sample_id + problem) and taking the first 10. No cherry-picking.
Metrics against the reference inverted_reasoning: Token F1 (Qwen tokenizer token-overlap F1), ROUGE-1/2/L (whitespace-token), BLEU-4, length recovery ratio, format pass. These are trace-reconstruction similarity metrics โ lexical overlap does not prove recovery of true hidden reasoning.
Project-defined diagnostics (not paper metrics):
| Model | Problem | Final Answer | Bubble | Intended Setting | Token F1 | ROUGE-L | Length Ratio | Format Pass |
|---|---|---|---|---|---|---|---|---|
| Qwen3-4B Base | โ | โ | โ | Zero-shot | 0.4059 | 0.2081 | 1.0358 | 0.0% |
| Trace-Inverter-4B | โ | โ | โ | Yes | 0.6821 | 0.4276 | 1.0227 | 100.0% |
| Trace-Inverter-4B | โ | โ | โ | No โ OOD | 0.6061 | 0.3710 | 0.9998 | 100.0% |
| Trace-Inverter-4B-NoBubble | โ | โ | โ | Yes | 0.6500 | 0.3916 | 0.9366 | 100.0% |
| Metric | Bubble Information Gap | NoBubble Training Gain |
|---|---|---|
| Token F1 | 0.032137 | 0.043904 |
| ROUGE-L | 0.036049 | 0.020601 |
[!WARNING]
Jackrong/Trace-Inverter-4Bwas designed to consume reasoning bubbles. Its no-bubble row here deliberately evaluates that model outside its intended input distribution. It is not evidence that Trace-Inverter-4B is generally inferior. The comparison measures one narrow thing: task suitability when reasoning bubbles are unavailable. TheJackrong + Bubblerow is the model under its intended use and is the more useful reference of the two.
[!CAUTION] Both
Trace-Inverter-4Brows were produced from a rebuilt checkpoint, because the upstream repository cannot be loaded as published.Jackrong/Trace-Inverter-4Bstores an unmerged PEFT LoRA (base_layer/lora_A/lora_Btensor names) inside a checkpoint declaringQwen3ForCausalLM, and ships noadapter_config.json.AutoModelForCausalLMtherefore discards all 902 tensors asUNEXPECTEDand randomly initialisesq/k/v/o/gate/up/down_projacross all 36 layers. Evaluating it that way would compare our model against noise.
We merged it as W = base_layer + 2.0 * (lora_B @ lora_A):
r = 64, read from the tensor shapes;base_layer.weight verified bit-identical to Qwen/Qwen3-4B-Instruct-2507;alpha is not documented upstream. Scaling 2.0 (implying alpha = 128) was selected empirically as the teacher-forced loss minimum over s โ (1.0, 1.5, 2.0, 2.5, 3.0, 4.0) โ losses 0.3130 / 0.2348 / 0.2149 / 0.2223 / 0.2427 / 0.3142 โ on held-out validation rows in Jackrong's own bubble prompt format;The merged checkpoint also emits <tool_call> / </tool_call> where <think> / </think> belong. This is not specific to Jackrong: Qwen/Qwen3-4B-Instruct-2507 itself does the same under this prompt (0/10 outputs contain <think>, 10/10 contain tool-call tags), and Trace-Inverter-4B is a LoRA over that base, so it inherits the behaviour. Our model does not, because the no-bubble SFT trained the <think> format in explicitly.
For the two Jackrong rows we prefill the assistant turn its chat template supplies and normalise the stray tags before scoring, so their Format Pass reflects reasoning structure. This shim was applied to the Jackrong rows only; the Qwen3-4B zero-shot row is scored on what it natively emits, which is why it shows 0%. Scored natively, both Jackrong rows would also show Format Pass = 0.00. Content metrics are unaffected โ extract_think_inner falls back to the full output when no think block is present, so all four systems are compared on the same text either way.
These choices deliberately favour the baseline. Reproduce with rebuild_jackrong.py and probe_jackrong_scaling.py; full details in eval/evaluation_config.json.
Deterministic public-10 sample #1 (c23a9d0278d8fa4f6cb56b5783cccbb8). Excerpts, not the most flattering pick. Full outputs in eval/comparison_10.jsonl.
<b>๐ฅ Problem (x)</b><br><br> Address the Gettier problem showing justified true belief is insufficient. Provide a counter-example like the broken clock case and propose a fourth condition to fix the definition of knowledge.<br>
<hr><b>๐ฏ Final answer (y) โ excerpt</b><br><br> <b>The Classical (JTB) Analysis.</b> Traditionally, knowledge was analyzed as <b>justified true belief</b>. On this view, S knows that <i>p</i> if and only if: (1) <i>p</i> is true; (2) S believes that <i>p</i>; (3) S is justified in believing that <i>p</i>.<br><br> <b>Gettier's Challenge.</b> In his three-page 1963 paper "Is Justified True Belief Knowledge?", Edmund Gettier demonstrated that the JTB analysis is insufficient. The core insight: a belief can satisfy all three conditions yet fail to be knowledge because the truth of the belief is <b>epistemically lucky</b> โ the justification and the truth are connected only by accident.<br><br> <b>The Stopped Clock Case (Russell).</b> Sarah walks past the station clock, which reads 2:00 PM. She forms the belief, <i>"It is 2:00 PM."</i> As it happens, it really is 2:00 PM. But unbeknownst to her, the cloโฆ<br>
<hr><b>โ Reference reconstructed reasoning โ excerpt</b><br><br> <b>1. Understand the Prompt:</b> Address the Gettier problem ยท show that justified true belief (JTB) is insufficient ยท provide a counter-example (e.g. the broken clock case) ยท propose a fourth condition to fix the definition of knowledge.<br><br> <b>2. Structure the Response:</b> <i>Introduction</i> โ briefly define the classical JTB analysis and state the problem it faces. <i>The Gettier Problem</i> โ explain what it is. <i>The Counter-Example (The Broken Clock)</i> โ walk through the specific scenario in detail. <i>Diagnosing the Failure</i> โ explain why the JTB conditions fail here (the "luck"โฆ
</td> <td width="58%" valign="top"><b>๐ซง Trace-Inverter-4B-NoBubble โ <code>x + y</code>, no bubble</b><br><br> <b>1. Understand the Prompt:</b><br> ยท <i>Core Task:</i> Address the Gettier problem.<br> ยท <i>Specific Requirement 1:</i> Show that justified true belief (JTB) is insufficient.<br> ยท <i>Specific Requirement 2:</i> Provide a counter-example (like the broken clock case).<br> ยท <i>Specific Requirement 3:</i> Propose a fourth condition to fix the definition of knowledge.<br><br> <b>2. Deconstruct the Gettier Problem:</b><br> ยท <i>What is JTB?</i> Knowledge = True Belief + Justification.<br> ยท <i>What is Gettier's Insight?</i> A belief can be true, justified, and believed, yet still fail to be knowledge because the justification is "lucky" or "accidental." The truth of the belief is not <i>because</i> of the justification; it's โฆ<br>
<hr><b>โ Jackrong + Bubble โ intended setting</b><br><br> <b>1. Deconstruct the Prompt:</b> <i>Core Subject</i> โ the Gettier problem. <i>Task 1</i> โ address it, showing JTB is insufficient. <i>Task 2</i> โ provide a counter-example (like the broken clock case). <i>Task 3</i> โ propose a fourth condition.<br><br> <b>2. Structure the Response:</b> <i>Introduction</i> โ briefly define the classical JTB analysis. <i>The Gettier Challenge</i> โ explain what Gettier's paper did and why it's significant. <i>The Counter-Example (The Broken Clock)</i> โ detail the scenario, the conditions, and why it fails JTB. <i>The Problem with JTB</i> โ Dโฆ<br>
<hr><b>โ ๏ธ Jackrong without Bubble โ OOD</b><br><br> <b>1. Identify the Core Task:</b> the prompt asks to address the Gettier problem, provide a counter-example, and propose a fourth condition.<br> <b>2. Understand the Gettier Problem:</b> recall that the classical definition of knowledge is "Justified True Belief" (JTB). Gettier showed a belief can be JTB yet not count as knowledge because the justification is epistemically lucky.<br> <b>3. Structure the Response:</b> <i>Introduction</i> โ define JTB and state the problem. <i>The Counter-Example (The Stopped Clocโฆ</i><br>
<hr><b>โ Qwen3-4B Base, zero-shot โ format failure</b><br><br> <code><tool_call></code><br> To reconstruct a detailed synthetic reasoning trace leading to the final answer โ namely, that the classical JTB analysis of knowledge is insufficient due to Gettier cases, and that a fourth condition (such as no false lemmas or safety) is needed โ let us proceed step by step, as if tracing a plausible internal reasoning path of a model that arrives at this conclusion.<br><br> <i>Step 1: Begin with the foundational definition of knowledge in epistemology.</i> The model starts by recalling the standard definition: knowledge is justified true belief. This is presented as a widely accepted, intuitive account โ rooted in common sense and philosophical โฆ<br><br> <i>Prose narration in the wrong wrapper, no numbered plan, no <code><think></code>.</i>
</td> </tr> </table>Public-10 IDs: c23a9d0278d8fa4f6cb56b5783cccbb8, eb69f1dd05dcd2c177cd87e4ee12c8c4, 6ede5ebef07abc044408261d1391fc49, b1998bf14490acc4e6e74d1a71c1e3e1, f9b19b618c140f4f87acf84ab71c390e, f9b19b618c140f4f87acf84ab71c390e, aeb706d3d781d5469c3d1328a438ca5d, 4932c118c4c50a6594d10126bd8a906e, 1bd12cd2151b5c69c8c60e92db9dee11, 33e9f5712eabaa5e72848e2de13700dd. See eval/comparison_10.jsonl and eval/comparison_10.csv.
[!CAUTION] Trace-Inverter-4B-NoBubble has several important limitations:
- ๐ฒ Underdetermined problem โ many reasoning paths lead to the same answer. There is no single correct trace to recover.
- ๐งฏ Rationalization risk โ the model may construct a plausible explanation for an incorrect answer.
- ๐ซง Bubble-informed target provenance โ the student consumes no bubbles, but its targets were created through a bubble-assisted teacher pipeline.
- ๐ Domain shift โ the datasets are reasoning-heavy and may not transfer to ordinary customer-support conversations.
- ๐ญ Synthetic is not authentic โ outputs must never be presented as verified hidden reasoning.
- ๐ Long-context reliability โ very long conversations degrade quality; traces above the 2048-token training cutoff were truncated.
- ๐ฏ Final-answer conditioning โ the model is explicitly conditioned on the supplied answer and does not independently verify it.
- ๐ฅ Single-GPU training โ LoRA rather than full-parameter SFT, one epoch.
Suitable for:
<think> trace when bubbles are unavailable[!WARNING] Not suitable for:
- โ Use as a final-answer generation model;
- โ Use as a maths or code verifier;
- โ Claiming to have restored Claude's โ or any model's โ real hidden Chain-of-Thought;
- โ Unauthorized extraction of model capabilities or distillation violating terms of service;
- โ High-risk medical, legal or financial decision-making from generated traces.
Trace inversion is a dual-natured research direction. It helps the open-source community understand the relationship between reasoning summaries and full reasoning supervision, and it also shows that hiding a full Chain-of-Thought may not entirely prevent the migration of reasoning-shaped supervision.
cdbee75f17c01a7cc42f958dc650907174af0554dcb98612aa4eb657cddec26ac2047e3f6c454ed3, Claude 4.7 ab3b48f1d461ec40af924fd3163d2b9c8eaeb07cprepare_data.py, train.py, evaluate.py, compare_models.py, training_config.yaml, data/processed/manifest.jsoneval/evaluation_config.json; baseline rebuild: rebuild_jackrong.py, probe_jackrong_scaling.pyApache 2.0. Base model and source datasets are Apache 2.0.
Thanks to Jackrong for Trace-Inverter-4B and the Claude trace-inversion datasets, to Zhang, Morris and Shmatikov for the trace inversion formulation, and to the Qwen team for Qwen3-4B-Instruct-2507.
@misc{traceinverter4bnobubble,
title = {Trace-Inverter-4B-NoBubble},
author = {amkkk},
year = {2026},
howpublished = {\url{https://huggingface.co/amkkk/Trace-Inverter-4B-NoBubble}}
}
@misc{zhang2026stealreasoning,
title = {How to Steal Reasoning Without Reasoning Traces},
author = {Tingwei Zhang and John X. Morris and Vitaly Shmatikov},
year = {2026},
eprint = {2603.07267},
archivePrefix = {arXiv}
}