TRANSMISSION // 2611.23205v1

What Fine-Tuning Teaches Small Models About MATLAB DSP

Source published

A laptop-based study found that fine-tuning improved Gemma models’ MATLAB signal-processing code, especially its handling of conventions. Errors in building signals remained.

AI-generated conceptual illustration for What Fine-Tuning Teaches Small Models About MATLAB DSP
AI-generated conceptual illustration; not documentary evidence.

Small language models can draft MATLAB code on a laptop, but mistakes in digital signal processing may produce plausible-looking results. A preprint tests whether fine-tuning can improve that code—and which errors persist.

The question: can a little training help on a laptop?

Digital signal processing relies on details that are easy to get wrong: the sign of a delay, the units of a chirp rate, or whether an array should be a row or a column. A program can still run and print a believable number even when one of these conventions is wrong.

Mehmet Altan Toksöz’s preprint asks whether examples can help two Gemma 4 edge models, E2B and E4B, write more reliable MATLAB code. The training and deployment used a laptop’s integrated GPU.

How the test worked

The study covers 11 signal-processing subtasks, including delay estimation with cross-correlation, matched filtering, FFT calculations, chirp generation and pulse descriptor words. Each task was expressed as a template with different numerical parameters. Six variants per task were used to create training examples, with two other variants held out for evaluation. Each held-out prompt was run with three random seeds, giving 66 evaluation runs per model and adapter.

The examples were built from expert reference solutions, but E2B generated the reasoning and code included in the training set. Automatic filters and checkers screened the examples, and the author read all 66. Twenty-five were manually edited; 10 edits changed what the code computed or printed. The paper notes that the checkers had accepted some incorrect code, and the training set is not released.

The models were adapted using supervised fine-tuning with LoRA or QLoRA, methods that train small adapter components rather than updating all model weights. Training took under an hour per adapter on the laptop’s integrated GPU. For evaluation, the models ran as 8-bit integer versions through OpenVINO. Generated MATLAB code was executed in a custom emulator, not MATLAB itself. Deterministic checkers assessed whether programs ran and returned expected values and, for some tasks, built the right arrays.

More passes, but not across the board

On the held-out runs, E2B passed 18 of 66 without an adapter, compared with 37 using LoRA and 37 using QLoRA. E4B passed 32 of 66 without an adapter and 47 with QLoRA. E2B’s mean score also increased; E4B’s rose from 68.7 to 84.7 out of 100.

The error analysis points to a specific strength: adapters helped with conventions that examples can state explicitly. For E2B, errors involving lag and index conventions fell from 17 failing runs to six with LoRA and five with QLoRA. Unit mistakes and row-versus-column shape errors also became less common. The author reports similar improvements for E4B in several categories.

But fine-tuning did not solve every kind of problem. Errors in constructing waveforms, delayed signals and noise changed less, and fractional-delay estimation remained especially difficult. Applying the adapters at run time reduced generation speed by 17–19% in the reported measurements. The paper also says adapted models produced shorter answers on average; the speed figures depend on the software setup and are described as indicative.

What the results do—and don’t—show

The evaluation tests new parameter values for known task templates. It does not establish that the models generalize to new signal-processing tasks, longer programs or unrelated code. One held-out prompt duplicated a training prompt; excluding it changed pass counts by at most two and did not change the model ordering. The evaluation is small, and each adapter came from one training run with settings that were not tuned through repeated experiments.

There are measurement limits too. The custom emulator may differ from MATLAB in edge cases. The checkers inspect selected outputs and arrays, not every line of code, so incorrect code can pass when an error does not affect a checked result. Conversely, an emulator difference could reject code MATLAB accepts. Error categories were assigned with help from an AI model, and the author notes that some labels could be drawn differently.

The result is a limited but informative demonstration: examples improved these models’ handling of several MATLAB and DSP conventions, while teaching them to build signals and noise remained harder. It is a single-author arXiv preprint. The paper calls for testing against MATLAB and on new tasks; its findings should be read within the specific setup it evaluated.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • Compressing Small Language Models: When Combining Techniques Helps—and When It Fails

    Shared method: Both studies use LoRA-based adaptation: the MATLAB study applies LoRA or QLoRA to improve DSP code generation, while the compression study uses LoRA to recover language-model perplexity after pruning. This is a shared adaptation method, not evidence that either study’s outcome transfers to the other; their tasks, models and evaluation measures differ.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.23205v1 — Original paper

      Excerpt reference: static/papers/2611.23205v1.md:523-599
      Basis: Paper text
      Source SHA-256: 64496f41f131b02441031aaa8d4413165390b68acdd906907f98cda385e5d893

    • 2611.00464v1 — Original paper

      Excerpt reference: static/papers/2611.00464v1.md:140-200
      Basis: Paper text
      Source SHA-256: 4828762a21355efcfe8a6ccef74428a1aaa44dbae3d44f3596676fe1ffa44d94

  • An Offline First-Aid AI Runs on a Phone—but Its Advice Falls Short

    Shared method: Both studies use QLoRA to fine-tune a small Gemma model for a specific task: MATLAB DSP code generation in one and first-aid responses in the other. Their evaluation settings and outcomes are not directly comparable, so this connection is methodological rather than evidence of similar effectiveness.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.23205v1 — Original paper

      Excerpt reference: static/papers/2611.23205v1.md:523-599
      Basis: Paper text
      Source SHA-256: 64496f41f131b02441031aaa8d4413165390b68acdd906907f98cda385e5d893

    • 2611.14059v1 — Original paper

      Excerpt reference: static/papers/2611.14059v1.md:179-260
      Basis: Paper text
      Source SHA-256: ffc8b3f2823a59df1dcae2a5638c22e877b3eb7a02a06c69635225a8f719573e

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.