SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.05643 · ICML · 2023

A Kernel-Based View of Language Model Fine-Tuning

Sanjeev Arora, Sadhika Malladi, Danqi Chen, Alexander Wettig, Dingli Yu

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2210.05643.json · badge: /api/ran/2210.05643.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
princeton-nlp/lm-kernel-ft canonical (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
FunctionStatusWhere it lives
default_dev_objective Ran
ran, honoured the contract we drafted
princeton-nlp/lm-kernel-ft/src/trainer.py
pointer only (licence: MIT); the stored copy get_code serves, from uijeongjang/lora-ntk, is pointer only (licence: NONE) · get_code("e448786d5ff1875a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from uijeongjang/lora-ntk, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

input_example_to_string Ran
ran; our contract draft was wrong, not the code
princeton-nlp/lm-kernel-ft/src/dataset.py
code served (permissive licence) · get_code("e768e25ca95f70cd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class Example:
    def __init__(self, text_a, text_b=None):
        self.text_a = text_a
        self.text_b = text_b

example_with_text_b = Example("Hello world", "This is text b")
example_without_text_b = Example("Hello world", None)

ARGS = {
    "example": example_with_text_b,
    "sep_token": "[SEP]"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
input_example_to_tuple Ran
ran; our contract draft was wrong, not the code
princeton-nlp/lm-kernel-ft/src/dataset.py
code served (permissive licence) · get_code("fbef70dc7c700501")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging
import pandas as pd

logger = logging.getLogger(__name__)

# Create a simple example class that mimics the structure needed
class Example:
    def __init__(self, text_a, text_b=None):
        self.text_a = text_a
        self.text_b = text_b

# Test case 1: example with both text_a and text_b
example_both = Example(text_a="Hello world", text_b="Goodbye world")

# Test case 2: example with only text_a
example_single = Example(text_a="Hello world", text_b=None)

# Test case 3: example with None text_a and None text_b
example_empty = Example(text_a=None, text_b=None)

# Use the most complete example for the ARGS dict
ARGS = {
    "example": example_both
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
text_classification_metrics Ran
ran; our contract draft was wrong, not the code
princeton-nlp/lm-kernel-ft/src/processors.py
code served (permissive licence) · get_code("b62076c5483738dc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct arguments for text_classification_metrics
task_name = "sentiment"

# Create predictions and labels as numpy arrays
# The function compares them with == and calls .mean()
preds = np.array([0, 1, 0, 1], dtype=np.int64)
labels = np.array([0, 1, 1, 1], dtype=np.int64)

ARGS = {
    "task_name": task_name,
    "preds": preds,
    "labels": labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tokenize_multipart_input Ran
ran on a synthesized input
princeton-nlp/lm-kernel-ft/src/dataset.py
code served (permissive licence) · get_code("7338b63ff734edaa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


class MockTokenizer:
    """Mock tokenizer with required methods and attributes."""
    def __init__(self):
        self.cls_token_id = 101
        self.mask_token_id = 103
        self.sep_token_id = 102
        self.vocab_size = 1000
        
    def encode(self, text, add_special_tokens=False):
        """Simple mock encode that returns token ids based on text length."""
        return [i % self.vocab_size for i in range(max(1, len(text) // 4))]
    
    def convert_tokens_to_ids(self, token):
        """Convert single token to id."""
        if isinstance(token, str):
            return hash(token) % self.vocab_size
        return token


# Create mock tokenizer
tokenizer = MockTokenizer()

# Create input text list
input_text_list = [
    "This is the first sentence.",
    "This is the second sentence.",
    "This is the third sentence."
]

# Create label word list (token ids representing label words)
label_word_list = [tokenizer.encode("positive")[0], tokenizer.encode("negative")[0]]

# Set up arguments
ARGS = {
    'input_text_list': input_text_list,
    'max_length': 128,
    'tokenizer': tokenizer,
    'task_name': 'sentiment',
    'prompt': False,
    'template': None,
    'label_word_list': label_word_list,
    'first_sent_limit': 50,
    'other_sent_limit': 40,
    'gpt3': False,
    'truncate_head': False,
    'support_labels': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tensor_all_gather Not yet run
unverified (harvested, no recorded run)
princeton-nlp/lm-kernel-ft/src/linearhead_trainer.py
code served (permissive licence) · get_code("c239cb1add74b809")
How it ran

no invocation recorded.

varsize_tensor_all_gather Not yet run
unverified (harvested, no recorded run)
princeton-nlp/lm-kernel-ft/src/linearhead_trainer.py
code served (permissive licence) · get_code("734d0491ecbc7841")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 6 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
input_example_to_string 9 other papers
4 dated earlier, 5 later
2110.01256 (2021-10)
Revisiting Self-Training for Few-Shot Learning of Language Model
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
and 6 more not named here
input_example_to_tuple 9 other papers
4 dated earlier, 5 later
2110.01256 (2021-10)
Revisiting Self-Training for Few-Shot Learning of Language Model
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
and 6 more not named here
default_dev_objective 7 other papers
4 dated earlier, 3 later
2110.01256 (2021-10)
Revisiting Self-Training for Few-Shot Learning of Language Model
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
and 4 more not named here
text_classification_metrics 6 other papers
3 dated earlier, 3 later
2110.01256 (2021-10)
Revisiting Self-Training for Few-Shot Learning of Language Model
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2205.01308 (2022-05)
Contrastive Learning for Prompt-Based Few-Shot Language Learners
and 3 more not named here
tensor_all_gather 2 other papers
2 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2310.09639 (2023-10)
DPZero: Private Fine-Tuning of Language Models without Backpropagation
varsize_tensor_all_gather 2 other papers
2 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2310.09639 (2023-10)
DPZero: Private Fine-Tuning of Language Models without Backpropagation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

It has become standard to solve NLP tasks by fine-tuning pre-trained language models (LMs), especially in low-data settings. There is minimal theoretical understanding of empirical success, e.g., why fine-tuning a model with 10 8 or more parameters on a couple dozen training points does not result in overfitting. We investigate whether the Neural Tangent Kernel (NTK)-which originated as a model to study the gradient descent dynamics of infinitely wide networks with suitable random initialization-describes fine-tuning of pre-trained LMs. This study was inspired by the decent performance of NTK for computer vision tasks (Wei et al., 2022). We extend the NTK formalism to Adam and use Tensor Programs (Yang, 2020b) to characterize conditions under which the NTK lens may describe fine-tuning updates to pretrained language models. Extensive experiments on 14 NLP tasks validate our theory and show that formulating the downstream task as a masked word prediction problem through prompting often induces kernel-based dynamics during fine-tuning. Finally, we use this kernel view to propose an explanation for the success of parameter-efficient subspace-based fine-tuning methods. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2210.05643")
get_code_for_paper("2210.05643")
have("2210.05643")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2210.05643.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2210.05643.svg)](https://syntology.ai/paper/2210.05643)

Connect an agent — have() is free.