Zero Labs
Industry News / AI

Big Teacher, Small Student: Can a 0.6B Language Model Learn Financial Reasoning from an 8B Model?

Source · Towards AI By Subodh Lonkar

From the publisher’s feed, collected in the ZeroLabs newsroom.

An end-to-end engineering journey through QLoRA, supervised fine-tuning, teacher-student distillation, hard-example mining, and targeted model adaptation.Source: https://www.slideteam.net/wp/wp-content/uploads/2023/01/One-Pager-Annual-Report-and-Financial-Statement-Presentation-Report.jpegHow to take a pretrained language model, specialize it for a real-world task, learn from a larger teacher, and build an extensible training pipeline — even when your compute budget is limited.Introduction: What if a smaller model could become a specialist?Imagine a financial analyst reviewing a company’s annual report.Source: https://www.slideteam.net/wp/wp-content/uploads/2023/01/One-Pager-Annual-Report-and-Financial-Statement-Presentation-Report.jpegThe report contains revenue, operating expenses, net income, cash flow, and financial ratios across multiple reporting periods.A colleague asks:What was the year-over-year revenue growth?How much did operating margin change?Which year had the highest net income?What was the percentage change in free cash flow?Can you calculate the ratio of total liabilities to total assets?A general-purpose language model may understand every word in the question and still produce an incorrect answer.It might select the wrong row, confuse two reporting periods, overlook a unit conversion, or produce a plausible-looking calculation that is not supported by the source document.This is a particularly interesting problem because financial question answering is not simply a language-generation task. It combines document understanding, table interpretation, numerical extraction, arithmetic, reasoning, and structured response generation.Now consider a different approach.Instead of training an entirely new language model, what if we started with an existing compact model and taught it to specialize in financial reasoning?What if we could also use a larger model as a teacher, learn from its responses, verify those responses, and transfer the accepted examples to the smaller model?And what if we could identify the smaller model’s mistakes and use those mistakes to construct a second training stage?That is the idea behind this project.I started with Qwen3–0.6B as the student model and Qwen3–8B as the teacher. I explored three adaptation strategies:Supervised Fine-Tuning (SFT): teach the student directly using gold-target financial examples.Knowledge Distillation: use a larger teacher model to generate candidate responses, verify them, and train the student on accepted examples.Distillation + Targeted SFT: start from the distilled student, identify errors on a separate mining pool, and continue training using corrected examples and replay.The experiments used FinQA and TAT-QA, along with programmatically generated synthetic financial examples. Training and inference were conducted using a free Google Colab Tesla T4 environment.The objective was not to claim that a short training run can produce a state-of-the-art financial model. It was to implement a complete, extensible methodology for adapting small language models under constrained compute.The interesting part is not just that three models were trained.It is how the data, supervision, training, validation, correction, evaluation, and deployment stages fit together.Let’s start at the beginning.1. Fine-tuning versus training from scratchOne of the most common misconceptions when starting with language models is that building a specialized model requires training one from scratch.That is rarely the most practical starting point.Training from scratch means teaching a model general language patterns and representations using a very large corpus. This involves substantial data, compute, optimization, and engineering.Fine-tuning starts with a model that has already learned useful language representations. We then adapt its behavior to a narrower task.Think of a newly hired financial analyst.They already understand accounting terminology, arithmetic, spreadsheets, and business communication. You do not need to teach them English or mathematics from the beginning.You need to teach them your organization’s reporting conventions, calculation formats, and review procedures.That is the intuition behind fine-tuning.A pretrained model already has useful capabilities. Fine-tuning changes its parameters so that it becomes more effective at a particular set of tasks.For this project, the starting models were:Student: Qwen3–0.6BTeacher: Qwen3–8BThe Qwen3–0.6B model is the compact student, while Qwen3–8B is the larger teacher.The teacher has roughly 10.9 times as many parameters as the student, based on the parameter counts recorded during the notebook’s model inspection.The idea was to investigate whether a compact student could acquire useful financial task behavior through carefully designed supervision.We did not build a new Transformer architecture. We adapted an existing pretrained one.That distinction is important because it changes the entire economics of the experiment.2. Understanding the datasets: Why FinQA and TAT-QA?A model cannot learn a specialized task effectively if the training examples do not represent that task.We selected two datasets that expose different aspects of financial question answering.2.1 FinQA: Numerical reasoning over financial reportsDataset: FinQA — GitHub repositoryFinQA focuses on numerical reasoning over financial reports and tables.Consider this simplified example:Financial metric20212022Revenue100120Operating expenses6070Net income1520Question:What was the percentage increase in revenue?The model must:Identify the revenue row.Locate the values for 2021 and 2022.Determine the appropriate mathematical operation.Execute the calculation.Return the answer with the correct scale.The calculation is:Growth = (120–100) / 100 × 100 = 20%This is more than language understanding. It combines table interpretation, numerical extraction, arithmetic, and answer formatting.A model that understands the question but selects the wrong year has failed. A model that selects the correct numbers but performs the wrong operation has also failed.The task therefore provides a useful environment for studying numerical reasoning in language models.2.2 TAT-QA: Questions over tables and accompanying textDataset: TAT-QA — GitHub repositoryTAT-QA contains questions that require interpreting both tables and textual context.For example, a question might ask for a financial measure whose value appears in a table but whose definition or reporting context is explained in an accompanying paragraph.The model must connect information across different parts of a document.This makes TAT-QA a useful complement to FinQA.FinQA emphasizes numerical reasoning over financial tables and reports, while TAT-QA introduces a hybrid table-and-text question-answering setting.2.3 Why use both?Financial question answering is not one homogeneous task.A model may be able to calculate a percentage but struggle to locate the correct values. It may read a table correctly but confuse the unit or scale. It may understand a textual explanation but fail to combine it with a table.Using both datasets creates a more varied task environment.The original dataset repositories contain substantially more examples than we used in this prototype. The notebook loaded the datasets and constructed a deliberately smaller experimental pool to keep training and teacher inference tractable on a free T4 GPU.The selected Stage 1 training pool contained 500 examples, distributed across three sources:FinQA: 200 examplesTAT-QA: 200 examplesSynthetic financial examples: 100 examplesTotal: 500 training examplesThe synthetic examples were generated programmatically with deterministic gold answers.They covered different financial metrics, reporting periods, numerical magnitudes, units, and question types.We also prepared separate validation, mining, test, and robustness pools.The notebook included document-overlap, exact-duplicate, near-duplicate, and contradictory-example checks. The reported leakage checks found no document overlap between the relevant evaluation splits and no exact or near-duplicate examples removed by those checks.This matters.Suppose the same annual-report table appears in both training and testing. The model might appear to perform well because it has already encountered the example.That would not be a meaningful test of generalization.Data preparation is therefore not just a preliminary step. It is part of the model-quality process.Composition of the 500-example stage-one training pool, combining FinQA, TAT-QA, and deterministic synthetic financial examples.3. The five-model experiment: One teacher, one baseline, three studentsBefore writing any training code, it helps to define the experimental design.The Five Model ConfigurationsM1 — Base Student (Qwen3–0.6B)The original, untuned model used as the student baseline.M2 — Supervised Fine-Tuning (Qwen3–0.6B + SFT)The student adapted using gold-standard supervised training examples.M3 — Knowledge Distillation (Qwen3–0.6B + Distillation)The student trained on teacher-generated responses that passed deterministic verification.M4 — Sequential Adaptation (Qwen3–0.6B + Distillation + SFT)A two-stage approach combining response-based distillation with targeted supervised fine-tuning.M5 — Teacher Reference (Qwen3–8B)The larger model used to generate candidate responses and provide a teacher-performance reference.The important design choice was to keep the same underlying student model for M1 through M4.This gives us a common starting point for studying different adaptation recipes.The teacher serves two purposes:It generates candidate supervision for the distillation experiment.It provides a larger-model reference during evaluation.M1 gives us a baseline. M2, M3, and M4 explore different ways of changing the student. M5 provides a larger reference point.Think of it as three different training programmes for the same analyst.One learns directly from verified examples. Another learns from a more experienced analyst. The third learns from that experienced analyst and then receives targeted corrections based on mistakes.The experimental design lets us study these different supervision strategies within a common model family.4. Before training: Designing the output contractOne of the most important engineering decisions was to define the model’s expected response format before training.Instead of allowing the model to return an unconstrained paragraph, we used a structured three-part response:Calculation: Answer: Scale: For example:Calculation: (120 - 100) / 100 * 100 = 20Answer: 20%Scale: percentFor insufficient context, the expected answer was:Answer: NOT_ANSWERABLEThe prompt also instructed the model to return CONFLICTING_INFORMATION when the supplied context contained conflicting values for the same quantity.Why is this useful?Imagine receiving the following answer:Revenue increased by 20 percent, which indicates positive growth.It sounds reasonable, but it does not expose the calculation.Now compare it with:Calculation: (120 - 100) / 100 * 100 = 20Answer: 20%Scale: percentThe second response is easier to parse, inspect, and validate.A structured output contract also creates opportunities for deterministic checks:Does the response contain the required fields?Can the arithmetic expression be evaluated?Does the calculated value match the reported answer?Is the answer consistent with the expected scale?Does the model abstain when the necessary information is missing?This does not guarantee that the model has reasoned correctly. It does, however, make its output more amenable to automated evaluation.That distinction is important:Format validity is not the same as answer correctness.This separation between response structure and answer quality becomes especially important when building automated training-data validation.5. How supervised fine-tuning worksLet’s begin with the most direct approach.5.1 The intuitionSuppose we want a model to answer financial questions in a particular format.We provide examples containing:A financial contextA questionA verified answerThe model learns to generate the target response when it receives the corresponding input.A simplified training example might look like this:SYSTEM:You are a careful financial analyst.Use only the supplied context.USER:Context:Revenue in 2021: 100Revenue in 2022: 120Question:What was the percentage increase?ASSISTANT:Calculation: (120 - 100) / 100 * 100 = 20Answer: 20%Scale: percentThe model processes the sequence as tokens and learns to predict the next token.During training, we compare its predictions with the expected target tokens.5.2 The training objectiveFor a causal language model, the standard supervised objective is next-token prediction.Training Objective (Negative Log-Likelihood Loss)Where:x = Input prompt.yₜ = Expected response token at position t.y₁, y₂, …, yₜ₋₁ = All preceding response tokens.θ = Model parameters.T = Total number of response tokens.The model is trained to assign higher probability to the expected response.An important implementation detail is response-only loss masking.We do not necessarily want the model to be penalized for predicting the prompt itself. The notebook masks prompt-token labels and computes the training loss on the response portion.Conceptually:labels = input_ids.clone()# Exclude prompt tokens from the loss.labels[:prompt_length] = -100# Supervise the response tokens.loss = model( input_ids=input_ids, labels=labels).lossThis is a simplified illustration of the loss-masking idea, not a complete training implementation.The actual pipeline also handles tokenization, padding, truncation, batching, attention masks, and checkpoint management.5.3 What did the SFT experiment learn from?The SFT model used 500 training examples:200 FinQA200 TAT-QA100 synthetic financial examplesThe targets were derived from gold annotations and deterministic synthetic generation.For FinQA, the notebook constructed arithmetic-expression targets from the gold programs or derivations. For TAT-QA, it used the corresponding gold answer annotations.No teacher-generated responses or teacher logits were used for this experiment.The resulting model became our first task-adapted student.This is the most straightforward approach to understand and implement when starting with fine-tuning.6. Why full fine-tuning was not the right choice for this experimentThe student model contains hundreds of millions of parameters.Updating every parameter would require storing more than just the model weights.Training also requires memory for gradients, optimizer states, intermediate activations, and other runtime allocations.For a limited GPU environment, that can become a significant constraint.This is where parameter-efficient fine-tuning becomes useful.6.1 LoRA: Learn a small update instead of rewriting the whole modelLoRA stands for Low-Rank Adaptation.Instead of updating the original weight matrix directly, LoRA freezes the original matrix and introduces a smaller trainable update.LoRA Weight UpdateWhere:W = Original pretrained weight matrix.A and B = Trainable low-rank matrices.B × A = Low-rank approximation of the required weight update.W’ = Updated weight matrix after applying the LoRA adaptation.The key insight is that the model does not necessarily need an unrestricted update to every original parameter to adapt to a downstream task.It can learn a constrained update through much smaller matrices.For an intuitive example, imagine modifying a large spreadsheet formula system.Instead of rewriting every formula, you introduce a compact set of adjustments that influence the relevant calculations.LoRA follows a similar principle.6.2 QLoRA: Combine low-rank adaptation with quantizationQLoRA adds another memory-saving technique.The pretrained model is loaded using 4-bit quantized weights, while the trainable LoRA adapters remain in higher precision.The base model remains frozen, and the adapters receive the parameter updates.The major components include:NF4 quantization: a 4-bit representation designed for normally distributed model weights.Double quantization: reduces the memory required for quantization constants.Paged optimizers: help manage memory pressure during training.The notebook used a QLoRA-style setup with:4-bit NF4 quantizationDouble quantizationFP16 computationPaged 8-bit AdamWGradient checkpointingThis was particularly useful because the Colab Tesla T4 does not support BF16 in the same way as newer GPU architectures.A simplified configuration looks like this:from transformers import BitsAndBytesConfigimport torchquant_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.float16)And a simplified LoRA configuration:from peft import LoraConfiglora_config = LoraConfig( r=16, lora_alpha=32, lora_dropout=0.05, task_type="CAUSAL_LM")The actual notebook applied adapters to attention and MLP projections, alongside gradient checkpointing and memory-aware training configuration.For this run, the trainable adapter parameter count was approximately 10.09 million.That is a compact trainable parameter set relative to the underlying student model.It is useful to understand what this does and does not mean.QLoRA reduces the memory footprint of the frozen base weights during training. It does not eliminate the need to load the base model or perform the forward and backward computations required to train the adapters.7. Experiment A: Gold-target supervised fine-tuningNow we can put the pieces together.The first adapted model was M2, the Finance-SFT student.Its training pipeline was:Load the Qwen3–0.6B base model.Prepare the model for 4-bit QLoRA training.Attach LoRA adapters.Prepare the gold-target instruction dataset.Apply response-only loss masking.Train for two epochs.Select the best checkpoint using validation loss.Merge the adapter into the base model.Validate the merged model against the adapter version.Training ConfigurationModel: Qwen3–0.6B + Supervised Fine-Tuning (SFT)Training examples: 500Epochs: 2Learning rate: 0.0001 (1 × 10⁻⁴)Effective batch size: 4Maximum sequence length: 1,024 tokensLoRA rank: 16LoRA alpha: 32LoRA dropout: 0.05Trainable parameters: 10,092,544Training duration: 837.5 seconds (approximately 14 minutes)GPU: NVIDIA Tesla T4Effective Batch Size CalculationThe effective batch size was achieved using a per-device batch size of 1 and gradient accumulation over 4 steps.Effective Batch Size = 1 × 4 = 4The training run completed successfully.The best recorded validation loss was approximately 0.3146, and the selected checkpoint was at step 120.One important detail: although the validation pool contained more examples, only 12 examples survived the configured validation selection and sequence-length filtering for this training run. This is a small checkpoint-selection sample, so the recorded validation loss should be interpreted accordingly.The adapter was then merged into the base model. The merge-validation procedure reported identical greedy outputs between the adapter and merged versions on the prompts used for that check.That is useful evidence that the merge preserved the tested behavior.It is not a guarantee of identical behavior across every possible input.What did we gain?We now had a model adapted directly to the financial task using verified target responses.But there is another interesting question:What if the training targets came from a larger model instead of being constructed directly from gold answers?That brings us to knowledge distillation.8. Knowledge distillation: Learning from a larger teacherImagine a junior analyst learning from a senior analyst.The senior analyst receives a financial question and explains how they would solve it. The junior analyst studies the explanation and learns to produce similar responses.That is the basic intuition behind teacher-student learning.In machine learning, a larger teacher model provides information that can be transferred to a smaller student.However, there are different ways to do this.8.1 Logit-based distillationIn classical logit-based distillation, the student is trained to approximate the teacher’s output probability distribution.The teacher produces a probability distribution over possible next tokens.The student produces its own distribution.KL-Divergence Distillation ObjectiveWhere:KL = Kullback–Leibler divergence, measuring the difference between the teacher’s and student’s probability distributions.P_teacher^T = Teacher’s softened probability distribution at temperature T.P_student^T = Student’s softened probability distribution at temperature T.T = Temperature parameter used to soften the probability distributions.T² = Scaling factor that compensates for the effect of temperature on gradient magnitudes.This approach requires access to teacher logits or probability distributions.8.2 Response-based or black-box distillationWhat if the teacher is available only through its generated responses?We can still perform a useful form of knowledge transfer.The teacher receives a prompt and produces a response. We then use that response as a candidate training target for the student.This is often called response-based or black-box distillation.It does not require teacher logits.That was the approach used in this project.The teacher generated structured financial calculation traces and answers. The candidate responses were then passed through deterministic validation.The important point is that we did not blindly trust every teacher response.A larger model can also make mistakes.8.3 Why verification mattersConsider a teacher response:Calculation: (120 - 100) / 100 = 0.2Answer: 20%Scale: percentThe arithmetic expression evaluates to 0.2, and the final answer is consistent with 20%.Now imagine a response where the calculation evaluates to 0.2 but the final answer says 25%.That response should not become a training target.The notebook implemented validation checks for:Response structureArithmetic expression parsingSafe arithmetic evaluationConsistency between the calculation and the final answerAgreement with the gold answerOnly responses passing the required checks were accepted for the teacher-supervised training set.This is a crucial distinction:We used the teacher to generate candidate supervision, but the gold annotations acted as the verification mechanism.The approach is therefore not unsupervised distillation.It is verified, response-based knowledge distillation using rejection sampling.8.4 The actual teacher-supervision workflowThe notebook used Qwen3–8B as the teacher in local 4-bit mode.The teacher-supervision stage contained 500 examples in total:400 responses were generated during the recorded run.100 examples were already available in the cache.Of the 400 newly generated responses, 149 passed the configured deterministic verification process.That represents a teacher-response acceptance rate of:Teacher Response Acceptance Rate = (149 ÷ 400) × 100 = 37.25%The rejected responses were not simply ignored. Their corresponding gold targets were retained as potential correction examples for the second-stage experiment.The accepted teacher responses were combined with 100 deterministic synthetic examples to construct the M3 target pool.After sequence-length filtering, 247 examples were used for M3 training.The pipeline can be represented as:This approach gives us a practical way to use a larger model as a source of candidate training examples without needing access to its internal logits.Teacher-response validation. Candidate responses are checked before they are admitted into the student training set.9. Experiment B: Training the distilled studentM3 started from the same Qwen3–0.6B base model as M2.The difference was the supervision source.M2 learned from gold-derived targets.M3 learned from verified teacher-generated responses, combined with the deterministic synthetic examples.Distillation Training ConfigurationModel: Qwen3–0.6B + Response-Based Knowledge DistillationUsable training examples: 247Epochs: 2Learning rate: 0.0001 (1 × 10⁻⁴)Effective batch size: 4Maximum sequence length: 1,024 tokensLoRA rank: 16LoRA alpha: 32LoRA dropout: 0.05Trainable parameters: 10,092,544Training duration: 404.2 seconds (approximately 6.7 minutes)GPU: NVIDIA Tesla T4The best recorded validation loss was approximately 0.4801, with the selected checkpoint at step 20.The adapter was merged into the base model and passed the same greedy-output merge validation used for M2.The key engineering outcome was not simply another trained checkpoint.It was a reusable teacher-supervision pipeline:Generate teacher responses.Cache them so generation can resume.Verify them automatically.Retain accepted targets.Construct a student training dataset.Train and merge the student.That workflow can be reused with a different teacher, student, or task.It also illustrates why teacher quality alone is not enough.A useful distillation pipeline needs a mechanism for deciding which teacher responses should become training targets.10. Experiment C: Distillation followed by targeted SFTThis was the most interesting part of the experimental design.A student that has been trained on teacher responses is not necessarily finished.It may still struggle with certain examples.What if we could identify those failures and use them to create a targeted correction dataset?That is the motivation behind M4.10.1 Why a second training stage?Think about a student preparing for an examination.They complete an initial practice test. Instead of repeating the entire syllabus, a teacher identifies the questions they struggled with and prepares additional exercises around those concepts.The next training stage becomes more targeted.The same idea can be applied to language-model adaptation.We start with the distilled student, evaluate it on a separate mining pool, and identify examples where it fails.These are not official validation or test examples. The mining pool was constructed separately from the final test subset.Keeping the mining pool separate from final evaluation data is essential.10.2 Building the correction datasetThe notebook used a 50-example mining pool.M3 failed 41 of those 50 examples.Second-Stage Training DatasetThe second-stage training dataset combined three complementary sources:1. Hard Examples — 41 examplesCorrect examples identified through student failure analysis, targeting areas where the distilled model struggled.2. Teacher-Rejection Corrections — 251 examplesGold-corrected examples corresponding to teacher-generated responses that failed the verification process.3. Replay Examples — 125 examplesSelected examples retained from the first training stage to preserve previously acquired capabilities and reduce forgetting.Total constructed dataset: 417 examplesThis composition combined targeted error correction, reliable gold supervision, and replay-based retention. One example was subsequently dropped during sequence-length filtering, leaving 416 usable training examples for stage-two training.After sequence-length filtering, 416 examples were used.Let’s understand each component.A. Hard-example miningThe distilled student was evaluated on the separate mining pool.Examples where it failed were selected for correction.This provides a way to make the next training stage more responsive to observed errors.Rather than training on a completely random collection of additional examples, we can use the model’s own performance to help prioritize what it should learn next.B. Gold-corrected teacher rejectionsSome teacher responses did not pass the verification procedure.Rather than automatically discarding the corresponding examples from the entire project, the pipeline used their gold targets to construct corrected training examples for the second stage.This turns the teacher-validation process into an additional source of useful training data.The teacher’s rejected response is not treated as correct. The gold annotation provides the correction.C. ReplayTraining only on new examples can cause the model to lose useful behavior acquired during the first stage.Replay addresses this by mixing a subset of earlier verified training examples into the second-stage dataset.It provides continuity between the original distillation objective and the targeted correction objective.10.3 The second-stage training runM4 continued from the best M3 adapter.Stage-Two Training ConfigurationModel: Qwen3–0.6B + Distillation + Targeted SFTUsable training examples: 416Epochs: 1Learning rate: 0.00003 (3 × 10⁻⁵)Effective batch size: 4Maximum sequence length: 1,024 tokensLoRA rank: 16LoRA alpha: 32LoRA dropout: 0.05Trainable parameters: 10,092,544Training duration: 342 seconds (approximately 5.7 minutes)GPU: NVIDIA Tesla T4Notice the lower learning rate.The model already had a task-specific initialization from the first stage. A smaller learning rate was used for continued adaptation.The best recorded validation loss was approximately 0.4005, with the selected checkpoint at step 100.The final model was merged and passed the same adapter-versus-merged greedy-output validation.The complete M4 pipelineTwo-stage knowledge distillation and targeted adaptation pipeline, from the base student to the final merged model.This is a useful experimental pattern because it separates initial knowledge transfer from targeted correction.It also provides a natural extension point for future work: improve the mining strategy, expand the correction dataset, and evaluate whether the changes produce repeatable gains across multiple seeds and larger test sets.One experimental-design qualification is worth making explicit: M4 receives additional training compute compared with M2 and M3. Consequently, any observed difference between M4 and the other students cannot be attributed solely to the two-stage recipe. More training steps are another possible contributor.That is precisely the kind of confound a larger follow-up experiment should control.Training and validation loss for the teacher-distillation and distillation-plus-targeted-SFT runs.11. How we trained on a free Colab Tesla T4Compute constraints influenced almost every engineering decision.The notebook detected an NVIDIA Tesla T4 with approximately 14.56 GB of GPU memory.A T4 is not equivalent to a modern high-end training GPU. We therefore used a configuration designed around the available resources.The key decisions were:11.1 QLoRA instead of full fine-tuningThe base model was loaded in 4-bit NF4 for training.This reduced the memory footprint of the frozen model weights.11.2 FP16 instead of BF16The T4 environment used FP16 mixed precision because BF16 was not supported by the detected GPU architecture in this setup.This is a practical reminder that precision settings should be selected based on the hardware, not copied blindly from another notebook.11.3 Gradient checkpointingGradient checkpointing reduces activation-memory requirements by recomputing selected activations during the backward pass.This trades additional computation for lower memory consumption.11.4 Paged 8-bit AdamWThe training configuration used a memory-conscious optimizer setup.11.5 Small effective batch sizeThe per-device batch size was 1, with gradient accumulation of 4.Effective Batch Size = 1 × 4 = 411.6 Restartable executionThe notebook wrote data, teacher responses, checkpoints, predictions, and reports to Google Drive.It used cached outputs and checkpoint-resume behavior so that an interrupted Colab session would not necessarily require repeating every completed stage.This is an underrated part of practical ML engineering.A notebook that trains successfully only when uninterrupted is less useful than one designed to recover from runtime disconnections.The pipeline was organized into distinct stages, making it possible to resume teacher generation and prediction generation from cached outputs and continue training from saved checkpoints.That is the difference between a one-off demonstration and a reusable experiment workflow.11.7 What did the training runs cost in GPU time?Student Training DurationM2 — Gold-Target SFTTraining duration: 837.5 seconds (approximately 14 minutes)M3 — Response-Based DistillationTraining duration: 404.2 seconds (approximately 6.7 minutes)M4 — Distillation + Targeted SFTTraining duration: 342.0 seconds (approximately 5.7 minutes)Note: These durations represent student training time only. Teacher-response generation and verification are separate pipeline stages and are not included in these figures.The teacher-supervision stage also required a separate inference run. Its recorded validation summary reported approximately 30 minutes of elapsed time.These numbers describe the notebook’s recorded execution, not a universal training-time estimate. Runtime depends on the Colab allocation, software versions, caching, model loading, sequence lengths, and other factors.The important point is that the pipeline was engineered to fit a constrained environment rather than assuming access to a large multi-GPU cluster.12. Training, validation, and model mergingA training loss curve can be useful, but it does not tell the whole story.The notebook tracked training and validation loss during each experiment.Best Checkpoint SelectionM2 — Gold-Target SFTBest checkpoint: Step 120Best recorded validation loss: 0.3146M3 — Response-Based DistillationBest checkpoint: Step 20Best recorded validation loss: 0.4801M4 — Distillation + Targeted SFTBest checkpoint: Step 100Best recorded validation loss: 0.4005Note: The best checkpoint for each experiment was selected based on its recorded validation loss. Lower validation loss indicates a better fit to the validation data under the training objective; it does not, by itself, establish superior task-level reasoning or generalization.These values are useful for understanding the optimization runs, but they should not be compared as direct measures of model quality across different training-target distributions.For example, the SFT targets and teacher-generated targets are not identical distributions.The validation sample was also small: 12 usable examples were retained for the training-time validation procedure after sequence-length filtering. This is not a sufficiently large validation set for making strong statistical claims about generalization.12.1 Why merge the adapters?During QLoRA training, the model consists of:The original pretrained model weightsThe trained LoRA adapter weightsFor deployment, it is often convenient to merge the adapter into the base model.Conceptually:LoRA Weight MergingWhere:W_merged = Final merged model weights.W_base = Original pretrained model weights.ΔW_LoRA = Learned weight update from the LoRA adapter.The resulting checkpoint can be loaded as a standard causal language model without separately attaching the adapter.In this project, the final student checkpoints were merged into FP16 weights.The notebook also performed a merge-validation check by comparing greedy outputs from the adapter model and its merged counterpart on selected prompts.All three trained variants passed that check.This is a useful deployment-oriented validation step.It helps ensure that the published merged artifact preserves the tested adapter behavior.It does not establish broad equivalence across every prompt or decoding configuration.13. How did we evaluate the five models?A model should not be evaluated only on the examples it was trained on.We evaluated M1 through M5 using the same sampled test examples and a common prompt and greedy-decoding configuration.The experiment used:50 FinQA test examples50 TAT-QA test examplesA 20-example synthetic robustness suiteThe comparison included the original 0.6B baseline, all three adapted students, and the 8B teacher.13.1 Why use a common evaluation harness?Suppose Model A receives a short prompt while Model B receives a much longer prompt containing additional instructions.Their outputs would not be directly comparable.The same applies to decoding settings.Using the same prompt and decoding configuration helps reduce unnecessary differences in the evaluation process.The notebook also cached predictions, recorded scorer details, and generated per-model reports.13.2 Numerical-answer performanceThe primary numerical-answer results from the sampled test evaluation were:1. Original Qwen3–0.6B (Baseline)FinQA: 0.00TAT-QA: 0.002. Finance-SFTFinQA: 0.28 (28%)TAT-QA: 0.40 (40%)3. Finance-DistilledFinQA: 0.24 (24%)TAT-QA: 0.18 (18%)4. Finance-Distilled-SFTFinQA: 0.20 (20%)TAT-QA: 0.18 (18%)5. Qwen3–8B (Teacher Reference)FinQA: 0.48 (48%)TAT-QA: 0.32 (32%)Each benchmark column represents 50 sampled examples.There are two important scoring qualifications.First, the FinQA metric was a deterministic numeric-answer scorer with an arithmetic-expression execution check. It was not the official FinQA program-matching metric, because the student was trained to output arithmetic expressions rather than the original FinQA DSL program.Second, the official TAT-QA scorer failed its self-test in this run. The notebook therefore used an explicitly labelled approximate fallback scorer.The TAT-QA values must not be presented as official benchmark results.Within these experimental conditions, the SFT student recorded 0.28 on the FinQA numeric scorer and 0.40 on the approximate TAT-QA scorer.The TAT-QA score was higher than the teacher’s recorded 0.32 on this sample, but because the fallback scorer was used, this should be treated as an exploratory observation rather than evidence that the student is generally better than the teacher.The useful result is that the three adaptation strategies produced different task-performance profiles, giving us a concrete basis for studying the effect of supervision strategy.13.3 Structured output validityOne useful engineering measure was whether the generated responses followed the expected structured format.1. Original Qwen3–0.6B (Baseline)FinQA: 96%TAT-QA: 98%2. Finance-SFTFinQA: 100%TAT-QA: 100%3. Finance-DistilledFinQA: 98%TAT-QA: 100%4. Finance-Distilled-SFTFinQA: 96%TAT-QA: 100%5. Qwen3–8B (Teacher Reference)FinQA: 100%TAT-QA: 100%The adapted students consistently produced outputs that followed the requested response structure in the sampled evaluation.However, format validity should not be confused with numerical correctness. A perfectly formatted answer can still contain an incorrect calculation.This is why we tracked formatting and answer accuracy separately.13.4 Teacher-relative retentionAnother useful way to inspect the results is to compare each student against the larger teacher.A retention value of 100% indicates that the student matches the teacher’s measured score on the evaluated sample. Values below 100% indicate a lower score, while values above 100% indicate a higher score on that particular evaluation.The notebook also computed 95% confidence intervals using paired bootstrap resampling.Recorded Overall Retention Results1. Finance-SFTOverall measured retention: 85.0%95% bootstrap confidence interval: 64.5%–112.9%2. Finance-DistilledOverall measured retention: 52.5%95% bootstrap confidence interval: 36.0%–72.7%3. Finance-Distilled-SFTOverall measured retention: 47.5%95% bootstrap confidence interval: 30.1%–66.3%Interpretation: Finance-SFT achieved the highest measured overall retention at 85.0%, followed by Finance-Distilled at 52.5% and Finance-Distilled-SFT at 47.5%.The confidence intervals are relatively wide, reflecting the limited evaluation sample. In particular, the Finance-SFT interval extends above 100%, so the point estimate should not be interpreted as evidence of statistical equivalence or superiority over the teacher. These findings are exploratory rather than conclusive.The SFT student recorded the highest measured overall retention among the three student variants in this particular experiment.Its benchmark-specific profile is also interesting:FinQA retention: approximately 58.3%.TAT-QA retention: approximately 125% under the approximate fallback scorer.The distillation student recorded approximately 50.0% FinQA retention and 56.3% TAT-QA retention.The two-stage student recorded approximately 41.7% FinQA retention and 56.3% TAT-QA retention.These are exploratory ratios, not claims of statistical equivalence with the teacher. The confidence intervals are wide, and the 90% retention target used in the experiment was not reached by any student.The value of this analysis is that it provides a common framework for comparing student performance against a larger reference model.It also illustrates why reporting a retention percentage without its underlying absolute score and confidence interval can be misleading.13.5 Robustness checksThe notebook also included a small synthetic robustness suite covering:Paraphrased questionsNumerical perturbationsMissing informationContradictory contextUnseen reporting periodsUnseen synthetic company namesLong financial tablesUnit and currency changesMulti-step calculationsUnanswerable questionsThese probes help reveal whether a model follows the intended response behavior when the prompt differs from a straightforward training example.Some encouraging observations appeared in this small suite:M2 achieved full success on the two baseline and two missing-information probes.M3 achieved full success on the missing-information probes.M4 achieved full success on the missing-information and unseen-period probes.The adapted students also recorded partial successes on paraphrased and unseen-company examples.These are small-sample observations, not robust generalization claims. There were only two examples per category.The suite is best viewed as a practical engineering smoke test that helps identify categories for more extensive future evaluation.It is not a replacement for a large, independently curated robustness benchmark.Synthetic robustness-suite results across the five models. Each category contains only two examples in this prototype.14. What did the inference-efficiency experiment show?This was one of the most interesting engineering parts of the project.A smaller model is attractive not only because of its parameter count, but also because it can be easier to store, load, and serve.We measured inference using:NVIDIA Tesla T4Batch size 1256 input tokens48 generated tokensOne warm-up iterationTwo timed iterationsThe following measurements were recorded during inference benchmarking on an NVIDIA Tesla T4 GPU.1. Original Qwen3–0.6B (Baseline)Latency per request: 2.505 secondsThroughput: 19.25 tokens/second2. Finance-SFTLatency per request: 2.367 secondsThroughput: 20.47 tokens/second3. Finance-DistilledLatency per request: 2.531 secondsThroughput: 18.93 tokens/second4. Finance-Distilled-SFTLatency per request: 2.286 secondsThroughput: 20.97 tokens/second5. Qwen3–8B (Teacher Reference)Latency per request: 4.480 secondsThroughput: 11.39 tokens/secondKey ObservationsFinance-Distilled-SFT recorded the lowest latency at 2.286 seconds per request and the highest throughput at 20.97 tokens/second among the evaluated models.Finance-SFT also showed slightly higher measured throughput than the original baseline.The Qwen3–8B teacher had the highest latency and lowest throughput in this particular test configuration.Within this particular short-run measurement, M4 recorded the lowest request latency among the five models.The student variants also achieved approximately 18.9–21.0 generated tokens per second.The teacher recorded approximately 11.4 tokens per second.The student models were measured in FP16, while the teacher was measured in 4-bit NF4. The comparison is therefore not a perfectly like-for-like precision comparison.These figures should be treated as indicative measurements from the notebook, not production-serving capacity estimates.Still, the experiment illustrates why model size and deployment efficiency matter.A specialized model that fits a smaller serving environment can be attractive for workloads where latency, memory, and infrastructure cost matter.14.1 Memory footprintThe merged FP16 student checkpoints were approximately 1.11 GB on disk in the measured setup.The original student model’s recorded Hub weight footprint was approximately 1.4 GB.The teacher’s original FP16 weights were approximately 15.26 GB, although the teacher was loaded in 4-bit NF4 for the inference measurement.Peak GPU Memory UsageThe following peak GPU memory measurements were recorded during the inference benchmark on an NVIDIA Tesla T4.1. Original Qwen3–0.6B (Baseline)Peak GPU memory: 3.30 GB2. Finance-SFTPeak GPU memory: 2.90 GB3. Finance-DistilledPeak GPU memory: 2.90 GB4. Finance-Distilled-SFTPeak GPU memory: 2.90 GB5. Qwen3–8B (Teacher Reference)Peak GPU memory: 7.58 GBKey ObservationAll three adapted student models recorded approximately 2.90 GB of peak GPU memory usage, compared with 3.30 GB for the original baseline and 7.58 GB for the teacher.This suggests that the adapted student models retained a relatively compact inference memory footprint in the tested configuration.These values are specific to the benchmark configuration, software stack, precision, and hardware.They should not be treated as universal memory requirements for every serving workload.14.2 Indicative serving-cost calculationThe notebook also included an illustrative cost calculation using an assumed GPU rate of USD 0.35 per GPU-hour.This is a modelling assumption, not a quoted cloud-provider price or an actual Colab bill.The estimated request cost depends on the benchmark’s short input/output lengths and timing assumptions. It does not include every component of a production service, such as CPU infrastructure, networking, storage, autoscaling, idle capacity, or operational overhead.The broader engineering lesson is that model adaptation and serving efficiency should be considered together.A model that is easier to host may be valuable even when its raw benchmark score is not the highest.Measured request latency across the five models on the Tesla T4.Inference Latency Comparison of our models.Measured token-generation throughput under the same short-run inference configuration.Peak GPU memory observed during the inference benchmark.15. The five models: What did we build?The final project consists of a baseline, three adapted students, and the teacher reference.Each model represents a different point in the experimental workflow.M1 — Original Qwen3–0.6BThe unmodified student checkpoint.It provides the reference point for measuring the effects of task-specific adaptation.Hugging Face: Qwen3–0.6BM2 — Qwen Finance-SFT 0.6BThe gold-supervised student.It was trained directly on financial instruction-response examples using QLoRA.Within the sampled evaluation, it recorded the strongest student results across both the FinQA numeric-answer scorer and the TAT-QA approximate scorer.Its defining characteristic is direct adaptation from gold-derived supervision.Hugging Face: Finance-SFTM3 — Qwen Finance-Distilled 0.6BThe teacher-response student.It was trained using accepted teacher-generated responses and deterministic synthetic examples.Its defining contribution is the verified black-box distillation workflow.Hugging Face: Finance-DistilledM4 — Qwen Finance-Distilled-SFT 0.6BThe two-stage student.It starts from the distilled model and continues training on hard examples, gold-corrected teacher rejections, and replay data.Its defining contribution is the failure-driven correction pipeline.Hugging Face: Finance-Distilled-SFTM5 — Qwen3–8B TeacherThe larger reference model used for teacher supervision and comparative evaluation.Hugging Face: Qwen3–8BTogether, these five models make the experiment easier to inspect and extend.The repositories provide a starting point for exploring how the same student architecture behaves under different adaptation strategies.16. What would a production-grade extension look like?A free Colab experiment is a useful starting point, but production systems require a different level of engineering.The methodology can be extended in several directions.16.1 Expand the training corpusThe current experiment used a deliberately compact training pool.A larger version could incorporate:More FinQA and TAT-QA examplesAdditional financial question-answering datasetsFinancial statement extraction examplesMore synthetic examples covering diverse reporting formatsCarefully reviewed domain-specific examplesMore varied company documents and reporting periodsThe important part is not simply increasing the number of rows.Data quality, task coverage, answer verification, and document diversity matter just as much.16.2 Improve teacher supervisionThe response-based distillation pipeline can be expanded with:Multiple teacher candidatesBetter teacher promptsStronger arithmetic validatorsUnit and currency normalizationMore robust answer-equivalence checksHuman review for ambiguous examplesConfidence-based or agreement-based filteringA teacher response should not become a trusted target merely because it came from a larger model.The verification pipeline is just as important as the teacher itself.16.3 Improve failure miningThe second-stage correction pipeline can become more sophisticated.For example, failures could be classified into categories:Incorrect table-row selectionWrong reporting-period selectionArithmetic errorScale or unit errorMissing-context handlingIncorrect output formattingFailure to recognize contradictory informationInstead of treating all failures equally, we could construct targeted training batches for each failure category.This is a natural next step for a more systematic self-improvement workflow.16.4 Improve evaluationA more serious evaluation programme should include:Full official benchmark test setsOfficial benchmark scorersMultiple random seedsLarger independent validation setsHuman-reviewed error categoriesConfidence and calibration evaluationCross-document generalizationMore realistic inference workloadsLonger-context evaluationStatistical significance testing with sufficient sample sizesA model should not be considered production-ready because it performs well on a small sample.The current run used one training seed, 50 examples per primary benchmark, and a small synthetic robustness suite.It also used a limited validation sample after sequence-length filtering.These are reasonable constraints for a prototype, but they are not sufficient for strong generalization claims.16.5 Control the training-compute confoundM4 receives additional training compute relative to M2 and M3.A stronger follow-up experiment should include compute-matched comparisons.For example:Give SFT and distillation the same number of optimizer steps.Compare a two-stage model with a single-stage model trained for an equivalent number of steps.Run multiple seeds.Keep data exposure and training budgets as comparable as possible.This would help isolate the effect of the two-stage correction strategy from the effect of additional training.16.6 Move to a proper training and deployment environmentFor larger experiments, the same workflow can move from Colab to managed cloud GPUs or dedicated training infrastructure.The pipeline itself does not need to be redesigned from scratch.Its stages can be separated into reusable components:Dataset preparationTeacher inferenceTarget validationStudent trainingCheckpoint selectionAdapter mergingEvaluationModel registry and deploymentThe training infrastructure can then scale independently of the methodology.The same process can also be adapted to other domains:Healthcare document question answeringLegal document extractionSupply-chain analyticsCustomer-support classificationEnterprise knowledge retrievalStructured information extractionDomain-specific numerical reasoningThe model and dataset will change, but the underlying engineering workflow remains useful.17. What can a beginner take away from this project?If you are new to fine-tuning and distillation, here is the sequence I would recommend following.Step 1 — Pick a pretrained modelStart with a model that fits your available hardware and is suitable for your task.Do not choose the largest model simply because it is available.Step 2 — Define one narrow taskAvoid trying to build a general-purpose assistant immediately.Pick a measurable problem such as classification, extraction, table QA, or structured response generation.Step 3 — Prepare high-quality examplesUnderstand the dataset, inspect examples, define the input/output format, and separate training, validation, and test data.Step 4 — Establish a baselineEvaluate the original model before adaptation.Otherwise, you cannot determine whether your training changed anything.Step 5 — Run supervised fine-tuningUse gold-target examples and learn how tokenization, loss masking, batching, learning rates, and checkpoints work.Step 6 — Explore LoRA and QLoRAUnderstand why parameter-efficient adaptation is useful and how quantization reduces memory requirements.Step 7 — Introduce a teacherGenerate candidate responses from a larger model.Do not automatically trust them.Step 8 — Validate teacher outputsUse deterministic checks where possible.Retain accepted examples and record why other examples were rejected.Step 9 — Train a distilled studentUse the accepted teacher responses as training targets.Step 10 — Mine failures and correct themCreate a separate mining pool, identify failure categories, construct corrected examples, and experiment with replay.Step 11 — Evaluate consistentlyUse the same prompts, examples, decoding configuration, and scoring procedures across model variants.Step 12 — Publish and documentSave model cards, training configurations, evaluation summaries, and inference examples.Make it possible for another engineer to understand what the model actually contains.The key lesson is that fine-tuning is not simply calling:trainer.train()It is an end-to-end process involving data design, supervision, optimization, verification, evaluation, and deployment.18. Final thoughts: The real value is the methodologyThe most valuable outcome of this project is not a claim that a 0.6B model has surpassed an 8B model.It is the implementation of a complete experimental workflow:The project demonstrates several practical ideas:A pretrained model can be adapted to a narrower task without retraining its entire parameter set.LoRA and QLoRA make experimentation more accessible under constrained GPU memory.Teacher-generated responses can become useful training data when they are independently verified.Rejected teacher responses can still provide opportunities for gold-target correction.Failure mining can guide a subsequent training stage.Replay can help retain examples from an earlier adaptation stage.Adapter merging and fresh-process validation help prepare checkpoints for distribution.Inference measurements help connect model adaptation with deployment considerations.The free Colab Tesla T4 environment imposed limits on dataset size, training duration, and evaluation scale.Those constraints were intentional parts of the prototype.With larger datasets, stronger compute, better teacher supervision, more extensive evaluation, and repeated experiments, the same methodology can be extended to build more capable task-specific learner models.There is a broader engineering lesson here.A successful model-adaptation project is not defined only by its final checkpoint. It is also defined by the quality of the training data, the reliability of the supervision process, the discipline of the evaluation methodology, and the ability to reproduce and extend the workflow.You do not need to begin with a massive GPU cluster.You need a well-defined problem, good data, a sound methodology, and the discipline to measure what you build.One final clarification: this project is an educational and experimental exercise. It is intended to demonstrate fine-tuning, knowledge distillation, and small-language-model engineering workflows. The resulting models are not production-validated financial systems and should not be used for financial decisions.References and further readingThe following papers and documentation provide useful foundations for the techniques discussed in this article.Hu et al. — LoRA: Low-Rank Adaptation of Large Language ModelsDettmers et al. — QLoRA: Efficient Finetuning of Quantized LLMsChen et al. — FinQA: A Dataset of Numerical Reasoning over Financial DataZhu et al. — TAT-QA: A Question Answering Benchmark on a Hybrid of Tabular and Textual Content in FinanceHugging Face — PEFT Quantization GuideHugging Face — Transformers DocumentationHugging Face — Qwen3–0.6BHugging Face — Qwen3–8BBig Teacher, Small Student: Can a 0.6B Language Model Learn Financial Reasoning from an 8B Model? was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.