ICON-LM: Captions, Numerical Tokens, and Next-Function Prediction

3 minute read

Published:

Core idea: numerical examples and textual descriptions can jointly specify an operator. Predicting successive output functions supplies multiple supervised targets from one prompt.

Paper: Liu Yang, Siting Liu, and Stanley J. Osher, Fine-Tune Language Models as Multi-Modal Differential Equation Solvers. Paper, arXiv v4 · Full text · Code. The authors’ publication record lists the journal version in Neural Networks, 2025.

The paper’s change to ICON

ICON-LM adds captions containing equations or natural-language information and uses a language-model-like architecture for next-function prediction. Numerical coordinates and values use embeddings distinct from text embeddings. A custom attention mask allows each output query to access the caption, earlier demonstrations, its current condition, and its own coordinate, while blocking the output being predicted. Query tokens do not attend to one another. The paper studies training from scratch and adapting language models, reporting improved numerical-only learning and benefits from captions. Architecture and training, Sections 4–5.

“Fine-tune” in the title concerns constructing the solver. Using the resulting solver on a new prompted task can still leave its parameters fixed.

Worked example: two sources of information

Imagine a family of scalar maps \(v=a u+b\). One numerical example, \(1\mapsto3\), gives only \(a+b=3\). There are infinitely many solutions. A second example, \(2\mapsto5\), determines \(a=2,b=1\).

Alternatively, a reliable caption saying “the map has zero intercept” constrains \(b=0\), so the first example identifies \(a=3\). The prediction at \(u_*=4\) is then 12, whereas the two-example map above gives 9.

This example illustrates why captions can reduce the amount of numerical evidence needed, and why contradictory captions are dangerous. The words are observations about the task, not mathematical constraints that a neural network necessarily enforces exactly.

Why masking is a scientific requirement

Write a training sequence schematically as

\[[c,u_1,v_1,u_2,v_2,u_3,v_3],\]

where \(c\) is a caption. When predicting \(v_2\), the model may use \(c,u_1,v_1,u_2\). It must not read \(v_2\) or use later tokens that have already read \(v_2\). Blocking one direct attention edge does not prevent a two-layer route through an intermediate token.

A useful implementation audit treats attention as a directed information-flow graph. If the target can reach a prediction through any permitted path over the layer stack, the evaluation leaks labels. A low training error then measures access to answers rather than successful inference.

A conceptual next-function objective is

\[\mathcal{L}=\sum_{j\in J}\|\widehat v_j(c,(u_i,v_i)_{i<j},u_j)-v_j\|^2.\]

The choice of \(J\) determines whether tasks with no preceding numerical example contribute to training. This is a supervision decision, separate from the network’s ability to process a longer sequence.

Three useful checks

CheckWhat it diagnoses
Correct versus shuffled captionsWhether the description carries task information
With versus without numerical pairsHow much identification comes from observations
Changing hidden target values before predictionWhether target information leaks through the computation

In the third check, legal prediction inputs remain identical. Predictions should therefore remain identical. This is stronger than simply checking that the displayed query omits its answer.

The method also does not make every differential equation a text-generation problem: numerical output heads and function samples remain central. The conservation-law study uses the numerical-only ICON-LM variant, which explains why later papers sometimes call that model simply “ICON.”