A 1.7B model built in two stages: knowledge distillation from a 30B Coder teacher to establish a structured reasoning backbone, then supervised fine-tuning on ~54,600 logical inference problems. The Coder teacher's decomposition patterns meet formal propositional logic.
The hypothesis: a model that learned STEM derivation from a Coder teacher (Stage 1) already has latent structure for sequential logic, state tracking, and compositional reasoning. Logical inference SFT (Stage 2) activates that structure explicitly — the model doesn't learn logic from scratch, it surfaces what the Coder teacher already gave it.
Qwen3-1.7B distilled from Qwen3-Coder-30B-A3B-Instruct — the coding-specialized variant of the 30B MoE architecture. Same STEM training data as the Instruct-teacher variants, but different teacher brain.
Why a Coder teacher? At distillation temperature T=2.0, the KL divergence transfers the teacher's full probability landscape — not just domain knowledge, but how the teacher organizes reasoning. The Coder variant organizes reasoning through precise sequential logic, explicit state tracking, and compositional decomposition. These are the same capabilities that make mathematical derivations rigorous and logical inference sound.
Data: 6,122 STEM chain-of-thought samples across 12 domains from 0xZee:
Domain
Samples
Physics
2,254
Linear Algebra
667
Differential Equations
636
Electromagnetism
580
Mathematics
576
Engineering
574
Classical Mechanics
343
Theoretical Mechanics
307
Advanced Calculus
268
Modern Physics
177
Physiology
114
Molecular Biology
71
Loss function:
Proof-Weighted Cross-Entropy (55%) — 2.5x → 1.5x on derivation tokens
Knowledge Distillation KL Divergence (45%) — T=2.0, scaled by T²
Stage 1 hyperparameters:
Parameter
Value
Epochs
1
Training samples
5,815
Effective batch size
8
Learning rate
1.5e-5 → 1e-6 (cosine)
Temperature
2.0
Proof weight
2.5 → 1.5
Precision
bf16
Training format:
Solve the following problem carefully and show a rigorous derivation.
Problem:
{question}
Proof:
{CoT}
Final Answer:
{response}
Stage 2: Logical Inference SFT
The distilled model was fine-tuned on KonstantinDob/logic_inference_dataset — ~54,607 instruction-response pairs covering propositional logic, logical entailment, and formal inference.
About the dataset: Reproduced from the LogicInference paper (Santiago Ontañón, Google Research). Uses the IID split only with LOGICINFERENCEe format — the model performs logical inference first, then gives the final answer at the end. 5,491 unique inference problems extended to ~54,607 instruction-response pairs. Three columns: INSTRUCTION, RESPONSE, SOURCE.
Why logical inference after Coder-distilled STEM? The Coder teacher gave the model structured decomposition patterns. The STEM data taught it to apply those patterns to derivations. Logical inference SFT takes the next step: formal propositional logic with explicit premises, inference rules, and conclusions. This is the most natural downstream task for a Coder-distilled reasoner — it's making the implicit structure explicit.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
34model_id ="reaperdoesntknow/Qwen3-1.7B-Coder-Distilled-SFT"56tokenizer = AutoTokenizer.from_pretrained(model_id)7model = AutoModelForCausalLM.from_pretrained(8 model_id,9 torch_dtype=torch.bfloat16 if torch.cuda.is_available()else torch.float32,10 device_map="auto",11)1213# Logical inference (Stage 2 format)14prompt ="""### Instruction:
15Consider the following premises: For all x, if x is a cat then x is a mammal. Whiskers is a cat. What can we infer?
1617### Response:
18"""1920# STEM derivation (Stage 1 format still works)21prompt_stem ="""Solve the following problem carefully and show a rigorous derivation.
2223Problem:
24Prove that the composition of two injective functions is injective.
2526Proof:
27"""2829inputs = tokenizer(prompt, return_tensors="pt").to(model.device)30with torch.no_grad():31 outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)32print(tokenizer.decode(outputs[0], skip_special_tokens=True))
### Instruction:
[Your question or logical inference problem]
### Response:
Intended Uses
Good for: Logical inference, propositional logic, formal reasoning, STEM derivation, structured argumentation, educational tutoring, component in verification pipelines, edge deployment via GGUF.
Not for: General code generation (the Coder teacher influence is structural, not functional — use a dedicated code model), formal proof verification (use Lean/Coq), safety-critical analysis, or tasks requiring long context beyond 1024 tokens.
Limitations
1.7B model. Produces structured reasoning but can generate fluent incorrect logic. The Coder teacher gives structural decomposition, not code generation capability. Logical inference performance is strongest on propositional logic patterns represented in the training data. Complex multi-step inferences with many quantifiers may exceed the model's capacity. Always verify.
This model's training pipeline is grounded in Discrepancy Calculus — a measure-theoretic framework that treats singularities as primary structure rather than pathology. Full theory: "On the Formal Analysis of Discrepancy Calculus" (CIx, 2026; Convergent Intelligence LLC: Research Division).
Standard knowledge distillation captures only term 1. Topological Knowledge Distillation (TKD) preserves all three by treating the teacher's output distribution as a BV function and computing discrepancy energy, jump sets, and gap energy density before training begins.
1@misc{cix2026codersft,
2 title={Coder-Distilled Logical Inference: Cross-Domain Structure Transfer
3 from Code to Formal Reasoning},
4 author={Convergent Intelligence},
5 year={2026},
6 publisher={HuggingFace},
7 url={https://huggingface.co/reaperdoesntknow/Qwen3-1.7B-Coder-Distilled-SFT},
8 note={Convergent Intelligence LLC: Research Division}
9}
References
Santiago Ontañón. "LogicInference: A Large-Scale Dataset for Logical Inference." ICLR 2023 Workshop on Mathematical and Empirical Understanding of Foundation Models.Paper | Code
Convergent Intelligence LLC: Research Division"Where classical analysis fails to see, we begin."
This model's training pipeline is grounded in Discrepancy Calculus — a measure-theoretic framework that treats singularities as primary structure rather than pathology. Full theory: "On the Formal Analysis of Discrepancy Calculus" (CIx, 2026; Convergent Intelligence LLC: Research Division).
Standard knowledge distillation captures only term 1. Topological Knowledge Distillation (TKD) preserves all three by treating the teacher's output distribution as a BV function and computing discrepancy energy, jump sets, and gap energy density before training begins.
The only BF16 collection in the portfolio. While the broader Convergent Intelligence catalog (43 models, 12,000+ downloads) was trained on CPU at FP32 for $24 total compute, the DistilQwen series was trained on H100 at BF16 with a 30B-parameter teacher. Same methodology, premium hardware. This is what happens when you give the pipeline real compute.
All models use proof-weighted knowledge distillation: 55% cross-entropy with decaying proof weights (2.5× → 1.5×), 45% KL divergence at T=2.0. The proof weight amplifies loss on reasoning-critical tokens, forcing the student to allocate capacity to structural understanding rather than surface-level pattern matching.