SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.03279 · ICLR · 2024

UniversalNER: TARGETED DISTILLATION FROM LARGE LANGUAGE MODELS FOR OPEN NAMED ENTITY RECOGNITION

Sheng Zhang, Muhao Chen, Hoifung Poon, Yu Gu, Wenxuan Zhou

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 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; 0 honoured the contract we drafted, 2 violated it and 2 have no contract verdict; 4 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2308.03279.json · badge: /api/ran/2308.03279.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
universal-ner/universal-ner community (classifier label)
classifier basis not recorded on the link
8 ran · 4 no recorded run
FunctionStatusWhere it lives
gen_prompt Ran
ran; our contract draft was wrong, not the code
universal-ner/universal-ner/src/train/fastchat/eval/eval_gpt_review.py
pointer only (licence: MIT); the stored copy get_code serves, from mbzuai-oryx/climategpt, is pointer only (licence: NONE) · get_code("a6a3ac30bf6e7bcf")
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 mbzuai-oryx/climategpt, 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.

get_response Ran
ran on a synthesized input
universal-ner/universal-ner/src/utils.py
code served (permissive licence) · get_code("fbd915d7d3d14137")
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 torch

torch.manual_seed(0)

# The function takes a list of strings, splits each by 'ASSISTANT:', takes the last part, and strips whitespace
# We need to construct valid test data: a list of response strings

responses = [
    "USER: What is 2+2? ASSISTANT: The answer is 4.",
    "SYSTEM: Processing... ASSISTANT: Here is the result."
]

ARGS = {
    "responses": responses
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
universal-ner/universal-ner/src/eval/evaluate.py
pointer only (licence: MIT); the stored copy get_code serves, from borealisai/radar-decoding, is pointer only (licence: LGPL-3.0) · get_code("e7e75981cb464788")
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 borealisai/radar-decoding, and LGPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

parse_score Ran
ran, violated the contract we drafted
universal-ner/universal-ner/src/train/fastchat/eval/eval_gpt_review.py
code served (permissive licence) · get_code("8049b382893c73dd")
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) 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

logger = logging.getLogger(__name__)

def parse_score(review):
    try:
        score_pair = review.split('\n')[0]
        score_pair = score_pair.replace(',', ' ')
        sp = score_pair.split(' ')
        if len(sp) == 2:
            return [float(sp[0]), float(sp[1])]
        else:
            raise Exception('Invalid score pair.')
    except Exception as e:
        logger.error(f'{e}\nContent: {review}\nYou must manually fix the score pair.')
        return [-1, -1]

# Valid review string with score pair on first line
review_valid = "8.5 9.2\nThis is a great product with excellent quality."

ARGS = {
    "review": review_valid
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
parser Ran
ran on a synthesized input
universal-ner/universal-ner/src/eval/evaluate.py
code served (permissive licence) · get_code("823ac03e72032fcb")
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 json
import re
import string

def normalize_answer(s):
    """Lower text and remove punctuation, articles and extra whitespace."""

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation)
        return ''.join((ch for ch in text if ch not in exclude))

    def lower(text):
        return text.lower()
    return white_space_fix(remove_articles(remove_punc(lower(s))))

def parser(text):
    try:
        match = re.match('\\[(.*?)\\]', text)
        if match:
            text = match.group()
        else:
            text = '[]'
        items = json.loads(text)
        formatted_items = []
        for item in items:
            if isinstance(item, list) or isinstance(item, tuple):
                item = tuple([normalize_answer(element) for element in item])
            else:
                item = normalize_answer(item)
            if item not in formatted_items:
                formatted_items.append(item)
        return formatted_items
    except Exception:
        return []

ARGS = {
    "text": "[\"Hello, World!\", \"The quick brown fox\", \"a test string\"]"
}
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 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
read_jsonl Ran
ran; our contract draft was wrong, not the code
universal-ner/universal-ner/src/train/fastchat/eval/generate_webpage_data_from_table.py
code served (permissive licence) · get_code("7beeb01acc36919e")
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 json
import os
import tempfile

# Create a temporary JSONL file with test data
temp_dir = tempfile.mkdtemp()
jsonl_path = os.path.join(temp_dir, "test.jsonl")

# Write test data to the JSONL file
test_data = [
    {"id": 3, "name": "charlie", "value": 30},
    {"id": 1, "name": "alice", "value": 10},
    {"id": 2, "name": "bob", "value": 20},
]

with open(jsonl_path, "w") as f:
    for item in test_data:
        f.write(json.dumps(item) + "\n")

# Define ARGS for the read_jsonl function
ARGS = {
    "path": jsonl_path,
    "key": "id"
}
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 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
trim_hanging_lines Ran
ran; our contract draft was wrong, not the code
universal-ner/universal-ner/src/train/fastchat/eval/generate_webpage_data_from_table.py
code served (permissive licence) · get_code("1d45bc90fd0cd90c")
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.

# Construct arguments for trim_hanging_lines

# The function takes a string with multiple lines and removes the first n lines
# It needs:
# - s: a string with at least n+1 lines (so we can split n times)
# - n: an integer specifying how many lines to remove

s = "line 0\nline 1\nline 2\nline 3"
n = 2

ARGS = {
    "s": s,
    "n": n
}
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
violates_moderation Ran
ran, violated the contract we drafted
universal-ner/universal-ner/src/train/fastchat/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Mi3-Lab/doScenes-VLM-Planning, is pointer only (licence: AGPL-3.0) · get_code("f9939a84b9a65279")
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 Mi3-Lab/doScenes-VLM-Planning, and AGPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

get_conv_template Not yet run
unverified (harvested, no recorded run)
universal-ner/universal-ner/src/conversation.py
code served (permissive licence) · get_code("dab937567e76e9e3")
How it ran

no invocation recorded.

get_eval Not yet run
unverified (harvested, no recorded run)
universal-ner/universal-ner/src/train/fastchat/eval/eval_gpt_review.py
code served (permissive licence) · get_code("26ac62acef82f73c")
How it ran

no invocation recorded.

get_gpu_memory Not yet run
unverified (harvested, no recorded run)
universal-ner/universal-ner/src/train/fastchat/utils.py
code served (permissive licence) · get_code("2f3cb5d0dcc18502")
How it ran

no invocation recorded.

preprocess_instance Not yet run
unverified (harvested, no recorded run)
universal-ner/universal-ner/src/utils.py
code served (permissive licence) · get_code("278f9963b50f1622")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 4 the same month, 8 later) and 4 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
normalize_answer 133 other papers
44 dated earlier, 3 the same month, 84 later, 1 same year, order not determinable, 1 undated · 1 only as an assembly brick
1508.06615 (2015-08)
Character-Aware Neural Language Models
1606.05250 (2016-06)
SQuAD: 100,000+ Questions for Machine Comprehension of Text
1608.07905 (2016-08)
Machine Comprehension Using Match-LSTM and Answer Pointer
and 130 more not named here
get_conv_template 69 other papers
4 dated earlier, 1 the same month, 63 later, 1 undated
1911.03705 (2019-11)
CommonGen: A Constrained Text Generation Challenge for Generative Commonsense Reasoning
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
and 66 more not named here
violates_moderation 56 other papers
1 dated earlier, 1 the same month, 54 later
2106.06909 (2021-06)
GigaSpeech: An Evolving, Multi-domain ASR Corpus with 10,000 Hours of Transcribed Audio
2308.13437 (2023-08)
Position-Enhanced Visual Instruction Tuning for Multimodal Large Language Models
2309.07120 (2023-09)
Sight Beyond Text: Multi-Modal Training Enhances LLMs in Truthfulness and Ethics
and 53 more not named here
get_gpu_memory 7 other papers
2 dated earlier, 1 the same month, 4 later
2305.10973 (2023-05)
Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold
2307.12981 (2023-07)
3D-LLM: Injecting the 3D World into Large Language Models
2308.11534 (2023-08)
PlatoLM: Teaching LLMs in Multi-Round Dialogue via a User Simulator
and 4 more not named here
parse_score 7 other papers
3 dated earlier, 4 later
2305.12031 (2023-05)
Clinical Camel: An Open Expert-Level Medical Language Model with Dialogue-Based Knowledge Encoding
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2307.02762 (2023-07)
PRD: Peer Rank and Discussion Improve Large Language Model based Evaluations
and 4 more not named here
read_jsonl 3 other papers
1 dated earlier, 2 later
2304.10453 (2023-04)
Phoenix: Democratizing ChatGPT across Languages
2403.18252 (2024-03)
Beyond Embeddings: The Promise of Visual Table in Visual Reasoning
2406.08100 (2024-06)
Multimodal Table Understanding
gen_prompt 2 other papers
1 dated earlier, 1 later
2305.12031 (2023-05)
Clinical Camel: An Open Expert-Level Medical Language Model with Dialogue-Based Knowledge Encoding
2312.09366 (2023-12)
Arabic Mini-ClimateGPT : A Climate Change and Sustainability Tailored Arabic LLM
trim_hanging_lines 2 other papers
2 later
2403.18252 (2024-03)
Beyond Embeddings: The Promise of Visual Table in Visual Reasoning
2406.08100 (2024-06)
Multimodal Table Understanding

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-23.

Repositories linked to this paper

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

Abstract

Large language models (LLMs) have demonstrated remarkable generalizability, such as understanding arbitrary entities and relations. Instruction tuning has proven effective for distilling LLMs into more cost-efficient models such as Alpaca and Vicuna. Yet such student models still trail the original LLMs by large margins in downstream applications. In this paper, we explore targeted distillation with mission-focused instruction tuning to train student models that can excel in a broad application class such as open information extraction. Using named entity recognition (NER) for case study, we show how ChatGPT can be distilled into much smaller UniversalNER models for open NER. For evaluation, we assemble the largest NER benchmark to date, comprising 43 datasets across 9 diverse domains such as biomedicine, programming, social media, law, finance. Without using any direct supervision, UniversalNER attains remarkable NER accuracy across tens of thousands of entity types, outperforming general instruction-tuned models such as Alpaca and Vicuna by over 30 absolute F1 points in average. With a tiny fraction of parameters, UniversalNER not only acquires ChatGPT's capability in recognizing arbitrary entity types, but also outperforms its NER accuracy by 7-9 absolute F1 points in average. Remarkably, UniversalNER even outperforms by a large margin state-of-the-art multi-task instruction-tuned systems such as InstructUIE, which uses supervised NER examples. We also conduct thorough ablation studies to assess the impact of various components in our distillation approach. We release the distillation recipe, data, and UniversalNER models to facilitate future research on targeted distillation. 1

For agents

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

get_harvested_code_for_paper("2308.03279")
get_code_for_paper("2308.03279")
have("2308.03279")

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

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

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

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

Connect an agent — have() is free.