SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.18487 · 2026

The Million-Label NER: Breaking Scale Barriers with GLiNER bi-encoder

Ihor Stepanov, Oleksandr Lukashov, Mykhailo Shtopko, Dmytro Vodianytskyi

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2602.18487.json · badge: /api/ran/2602.18487.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
urchade/GLiNER canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
Knowledgator/utca canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
FunctionStatusWhere it lives
block_diag_mask Ran
ran; our contract draft was wrong, not the code
urchade/GLiNER/gliner/infer_packing.py
code served (permissive licence) · get_code("158f9ec60e4391da")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create a small batch of segment IDs
# shape: (batch_size=2, seq_len=4)
# segment_ids should contain integer IDs indicating which segment each token belongs to
segment_ids = torch.tensor([
    [0, 0, 1, 1],
    [0, 1, 1, 0]
], dtype=torch.long)

ARGS = {
    "segment_ids": segment_ids
}
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 4) as a later run recorded it
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
create_projection_layer Ran
ran; our contract draft was wrong, not the code
urchade/GLiNER/gliner/modeling/layers.py
code served (permissive licence) · get_code("2feea7f5bd66fdee")
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 Sequential. 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "hidden_size": 64,
    "dropout": 0.1,
    "out_dim": 32,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
cross_entropy_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
urchade/GLiNER/gliner/modeling/loss_functions.py
code served (permissive licence) · get_code("bb1f6cd5ab3e0c98")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for cross_entropy_loss
batch_size = 2
seq_len = 3
num_classes = 4

# inputs: shape [batch_size, seq_len, num_classes]
inputs = torch.randn(batch_size, seq_len, num_classes)

# targets: shape [batch_size, seq_len] with class indices
targets = torch.randint(0, num_classes, (batch_size, seq_len))

# Some targets set to ignore_index
targets[0, 0] = -100

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "reduction": "mean",
    "label_smoothing": 0.1,
    "ignore_index": -100,
}
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 Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
ensure_dict Ran
ran; our contract draft was wrong, not the code
Knowledgator/utca/src/utca/implementation/predictors/utils.py
code served (permissive licence) · get_code("9fe5a4897b9e90a2")
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
from typing import Any, Dict

torch.manual_seed(0)

# Test case 1: non-dict input (will be wrapped with default key)
non_dict_data = torch.randn(2, 4)

# Test case 2: dict input (will be returned as-is)
dict_data = {"output": torch.randn(2, 4), "loss": torch.tensor(0.5)}

# Test case 3: custom key for wrapping
custom_key = "result"

ARGS = {
    "data": non_dict_data,
    "key": "output"
}
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 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
focal_loss_with_logits Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
urchade/GLiNER/gliner/modeling/loss_functions.py
code served (permissive licence) · get_code("89ad194773a52ef8")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create small tensors for inputs and targets
batch_size = 2
num_elements = 4

inputs = torch.randn(batch_size, num_elements)
targets = torch.randint(0, 2, (batch_size, num_elements)).float()

ARGS = {
    'inputs': inputs,
    'targets': targets,
    'alpha': 0.25,
    'gamma': 2.0,
    'prob_margin': 0.0,
    'reduction': 'none',
    'label_smoothing': 0.0,
    'normalize_prob': True,
    'ignore_index': -100,
    'eps': 1e-6,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
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
span_dice_loss Ran
ran; our contract draft was wrong, not the code
urchade/GLiNER/gliner/modeling/loss_functions.py
code served (permissive licence) · get_code("97eb64be5eb359ca")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create small tensors for testing
# inputs: predicted logits, shape (batch=2, length=3, classes=4)
inputs = torch.randn(2, 3, 4)

# targets: ground truth binary labels with same shape, values in {0, 1, -100}
targets = torch.tensor([
    [[1, 0, 1, 0], [0, 1, 0, 1], [1, 1, 0, 0]],
    [[0, 0, 1, 1], [1, 0, 1, 0], [-100, -100, -100, -100]]
], dtype=torch.float32)

gamma = 1.0
reduction = 'none'
ignore_index = -100
eps = 1e-06

ARGS = {
    'inputs': inputs,
    'targets': targets,
    'gamma': gamma,
    'reduction': reduction,
    'ignore_index': ignore_index,
    'eps': eps
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
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
unpack_spans Ran
ran; our contract draft was wrong, not the code
urchade/GLiNER/gliner/infer_packing.py
code served (permissive licence) · get_code("8108004b8b9c81ba")
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. 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
from typing import List

torch.manual_seed(0)

# Create a small PackedBatch
num_streams = 2
max_len = 5
hidden_dim = 4

input_ids = torch.randint(0, 100, (num_streams, max_len), dtype=torch.long)
attention_mask = torch.ones((num_streams, max_len), dtype=torch.long)
pair_attention_mask = torch.ones((num_streams, max_len, max_len), dtype=torch.bool)
segment_ids = torch.tensor([[0, 0, 1, 1, 0], [0, 1, 1, 0, 0]], dtype=torch.long)

# Create mapping metadata: 3 requests total
# Stream 0: request 0 (offset 0, len 2), request 1 (offset 2, len 2)
# Stream 1: request 2 (offset 0, len 3), request 1 (offset 3, len 1)
map_out = [[0, 1], [2, 1]]
offsets = [[0, 2], [0, 3]]
lengths = [[2, 2], [3, 1]]

packed = __import__('dataclasses').replace(
    type('PackedBatch', (), {
        'input_ids': input_ids,
        'attention_mask': attention_mask,
        'pair_attention_mask': pair_attention_mask,
        'segment_ids': segment_ids,
        'map_out': map_out,
        'offsets': offsets,
        'lengths': lengths,
    })()
) if False else type('PackedBatch', (), {
    'input_ids': input_ids,
    'attention_mask': attention_mask,
    'pair_attention_mask': pair_attention_mask,
    'segment_ids': segment_ids,
    'map_out': map_out,
    'offsets': offsets,
    'lengths': lengths,
})()

# Create per_token_outputs tensor: (num_streams, max_len, hidden_dim)
per_token_outputs_torch = torch.randn(num_streams, max_len, hidden_dim)

ARGS = {
    'per_token_outputs': per_token_outputs_torch,
    'packed': packed,
}
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 list — a list output has no array shape of its own; none is 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
normalize_context_encoder_config Not yet run
unverified (harvested, no recorded run)
urchade/GLiNER/gliner/config.py
code served (permissive licence) · get_code("aeb19abdcb592e65")
How it ran

no invocation recorded.

pack_requests Not yet run
unverified (harvested, no recorded run)
urchade/GLiNER/gliner/infer_packing.py
code served (permissive licence) · get_code("0dc006c58f0688d1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

This paper introduces GLiNER-bi-Encoder, a novel architecture for Named Entity Recognition (NER) that harmonizes zero-shot flexibility with industrial-scale efficiency. While the original GLiNER framework offers strong generalization, its joint-encoding approach suffers from quadratic complexity as the number of entity labels increases. Our proposed bi-encoder design decouples the process into a dedicated label encoder and a context encoder, effectively removing the context-window bottleneck. This architecture enables the simultaneous recognition of thousands-and potentially millions-of entity types with minimal overhead. Experimental results demonstrate state-of-the-art zero-shot performance, achieving 61.5% Micro-F1 on the CrossNER benchmark. Crucially, by leveraging pre-computed label embeddings, GLiNER-bi-Encoder achieves up to a 130× throughput improvement at 1024 labels compared to its uni-encoder predecessors. Furthermore, we introduce GLiNKER, a modular framework that leverages this architecture for high-performance entity linking across massive knowledge bases such as Wikidata.

For agents

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

get_harvested_code_for_paper("2602.18487")
get_code_for_paper("2602.18487")
have("2602.18487")

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

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

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

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

Connect an agent — have() is free.