Search arXiv⌕ Search

arXiv subjects

Zongqi Fan

Publications and source records attributed to Zongqi Fan.

6 recordsLinked to original sources

How to Turn an Attention Neural Network into an Interpretable Hard-Logic Predicate Circuit: Truth-Table Predicate Extraction and State-Machine Merging under Ship-of-Theseus Replacement

We convert a trained attention network as a whole, attention included, into a hard-logic predicate circuit that runs in its place. Every unit of the circuit is a 0/1 predicate on tokens, and every map between predicates is a minimised truth table. Short tables, such as the product of a query code and a key code, are minimised exactly, and wide feature-to-feature transitions become implication rules by noise-tolerant minimisation. Blocks are replaced one at a time from the output down, in the manner of the Ship of Theseus, and after each replacement the remaining soft part re-adapts to the frozen circuit. Attention selection takes two forms, a row-wise comparison of integer scores (order selection) and a learned rule (rule selection). Both are fitted on the ordinary training set alone, and only on the examples that the teacher classifies correctly, so that the circuit imitates the teacher where the teacher is right. On TweetEval-emotion, the complete circuit of DistilGPT2 reaches a test gold accuracy of 66.5 $\pm$ 1.3% with order selection and 57.4 $\pm$ 2.5% with rule selection over three seeds, against 74.7% for the teacher and 64.0% for a bag of word pieces fitted on the same tweets, and that of BERT-base reaches 70.0 $\pm$ 0.5% with order selection and 63.7 $\pm$ 1.2% with rule selection against 77.8%. The circuit needs no multiplier and no weight traffic, and its exported hardware description reproduces it bit for bit. By a synthesis-based estimate it classifies one tweet in about 1-2 $μ$s (DistilGPT2) and 3-5 $μ$s (BERT) on an FPGA card and in 5-9 $μ$s on a palm-sized board whose module draws 7.5-15 W, two to three orders of magnitude faster than the network on a GPU at batch 1 (measured, 0.9-2.6 ms for DistilGPT2 including an optimised CUDA-graph baseline), at a cost of 8.5 (DistilGPT2) and 8.6 (BERT) points of gold accuracy for the synthesised seed-0 circuits.

cs.LG↗

How Many Training Labels Are Wrong? Auditing a Fitted Model through Gradient Allocation

How many labels in a training set are wrong, and which ones? The usual answers read a held-out set or the model's outputs. A held-out reading depends on how the held-out set was drawn, and an output-based reading fails once the model has fitted its wrong labels, because the loss of a fitted wrong label is small and the prediction agrees with it. We read the answer from the per-example gradients of a single trained model. Each example, together with its label, asks the network to change in a particular way. We normalise the magnitudes of its gradient into a gradient allocation and compare it with the mean allocation of every class. An example is flagged when relabelling it as its nearest other class makes its allocation fit better than under its own label, and the share of flagged examples is the reading of the noise rate. The rule has no threshold and needs no clean data, no held-out set and no further training. After the model has fitted 99-100% of its wrong labels, the allocation still separates wrong from right labels with an AUC of 0.94-0.96 on the noisiest human labels of CIFAR-10N, where a feature-space margin falls to 0.79-0.84 and the loss, the gradient norm and the self-influence of an example to 0.73-0.76. On such a fitted model, readings of the noise rate from predictions or feature margins fall to 0-6% at true rates of 8-58% on CIFAR-10 with ViT-S, while the audit reads 54-96% of the true rate, and at least 93% of the examples it counts carry wrong labels. On a briefly trained model, before the wrong labels are fitted, the reading lies within 1.7 percentage points of the true noise rate on CIFAR-10 from 0% to 58% noise. Confident learning, which trains four further models, separates wrong labels about as well (AUC 0.925-0.998 against 0.900-0.995) and mostly reads the noise rate more closely, at a lower precision. An audit of 5,000 examples takes 14 to 27 seconds on one GPU.

cs.LG↗

Routing in Gradient Space: Balanced Usage Is Not Expert Specialization

Sparse expert models can distribute traffic evenly while still grouping incompatible training signals within the same experts. We study routing as a gradient-partitioning problem and introduce gradient-aligned routing (GAR), whose load-normalized router objective rewards grouping observations with aligned gradients. On five multi-task text-classification mixtures, we compare GAR with task-loss-only routing, gradient-combination and gradient-conflict methods, and load-balancing losses. With a fully trainable RoBERTa backbone and classification-head experts, GAR has the highest aggregate validation accuracy, 1.07 percentage points above task-loss-only routing. With frozen DeBERTa and Qwen3-1.7B backbones and low-rank adapter experts, it again ranks first, 1.10 points above task-loss-only routing, with better-balanced expert load and higher gradient-mass purity, the share of each expert's gradient-norm mass from its dominant task; the load-balancing losses flatten load further but leave this purity near its task-loss-only level. Top-1 routing, trainable full-parameter feed-forward network (FFN) experts, and a larger backbone also show positive aggregate gains. In component ablations, the objective's cross-observation alignment terms alone retain GAR's accuracy, and GAR keeps its accuracy when observations are formed without task identity; supervising the router with task labels raises task-expert association without adding accuracy. The results distinguish expert-load balance from gradient-based routing organization and show the predictive value of gradient-informed routing in multi-task text classification.

cs.LG↗

Where Is the "Self" of a Large Language Model? -- From Self-Index to Self-Reference

Whether a large language model has a self is usually argued rather than measured. We introduce a quantitative test of a functional self at two levels known from biology: a self-index that marks material as one's own, and self-reference, the ability to recognize it. We place one text in an Assistant, User, or System message of the chat template, so only its source differs. In 13 of 25 open-weight models from 14 developers, internal representations set the model's own message apart, and next-token predictions and the persistence of the difference along the message follow this self-index. No model recognizes its own messages without it (chance probability 0.004). Editing a few directions per layer that carry the index removes recognition in seven models and modes and changes the role a model takes in a game that never asks who wrote a message. Self-reference is thus a readout of the self-index.

cs.CL↗

Why Does Train-Validation Separation Emerge? Gradient-Allocation Dynamics in Pretrained Fine-Tuning

During fine-tuning, training accuracy often keeps rising after validation accuracy has levelled off. We explain this growing train-validation gap with a support-transfer account: early updates use structure shared by many examples, whereas later fitting relies increasingly on narrow structure whose benefit transfers less to held-out data, so per-example gradient allocations differentiate as the gap grows. We measure this with two readouts computed from fixed training probes alone, the pooled dispersion $D_{\mathrm{den}}$ of normalized gradient magnitudes and its within-class part $D_{\mathrm{within}}^{\mathrm{wt}}$, and derive sufficient conditions under which allocation dispersion, cross-entropy separation, and the accuracy gap grow together. In a constructed feature hierarchy, raising the sample-private feature share from .3 to .7 raises the final accuracy gap from .185 to .527, and homogenizing per-example gradient magnitudes reduces the gap mainly after substantial fitting (median full-dose changes of -4.91 to -11.79 percentage points when it starts at the three later training stages). In 90 fine-tuning runs of three language backbones on six tasks, both readouts are positively associated with the accuracy gap in every run, and $D_{\mathrm{den}}$ remains positive in 89 of 90 runs after linear detrending; 20 vision runs show the same association.

cs.LG↗

Backpropagated Output Momentum: Relocating Optimizer History from Parameters to Task Space

Optimizer momentum is usually stored as a parameter-sized moving average of past gradients, which makes history costly and fixes each past signal in the coordinates in which it was computed. We introduce Backpropagated Output Momentum (BOM), which instead stores a compact moving average of prediction errors at the model output and reprojects that history through the current network at every step. A batch-level analysis characterizes the information retained and omitted by this relocation, while the implementation preserves the current supervised gradient and can replace the first-moment component of several adaptive optimizers. As a plug-in for momentum-based optimizers, including ones that already compress their state, BOM reduces parameter-shaped optimizer state by 49.7-99.8% in three compositions and, averaged over three language backbones, paired step time by 4.0%. It also improves mean validation performance across language and vision fine-tuning, by 1.42 points in the primary five-task comparison. Language and vision pretraining studies, together with matched mechanism controls, further test the construction across output spaces and model scales.

cs.LG↗