Schema-Conditioned Typed Decisions for Structured Extraction
When extraction must follow a user-provided schema, CALON jointly encodes schema and text, then makes typed decisions over candidate spans and ordered span pairs with a null option.
Read the paper ↗What it is
- Schema–text interaction The model reads the text together with the type names and descriptions you ask it to use, so candidate decisions can depend on the current schema.
- Typed candidate choices A text span or ordered pair of spans is assigned one queried type or a null choice meaning none of the requested types.
- Events reuse spans and pairs Event triggers are predicted as spans; arguments are spans connected to triggers by role-labelled pair decisions.
Why it matters
This gives one decision pattern for entity, relation, and event extraction while letting a user change the queried schema. It also makes the scope of each decision explicit: a span or directed pair can match a requested type, or match none.
Before getting into the machinery, here is the short version: the model reads a text alongside the types you want it to find. It then considers spans and pairs of spans, choosing a requested type or saying that the candidate matches none of them. That lets the same basic setup cover entities, relations, and event structure.
-
The schema is part of the input: If you ask an ordinary classifier for a label it was never trained to predict, it has no obvious way to understand that label. Here, type names and optional descriptions are encoded with the text. The canonical example is asking for “Person” and “Organization” while reading “Alice works at Acme”: the model has the requested categories in view while it represents the sentence. It is not magic open-ended understanding; it is still making decisions among the types you supplied.
-
Candidates need a way to say no: For “Alice,” the system needs to choose among the queried types, but it also needs an answer for “none of these.” That null choice is useful whenever a candidate span exists but is not an instance of a requested type. The core decision is a probability distribution over null and the queried labels; in words, it spreads confidence across the available answers, including rejection. Candidate spans are built from boundary information, the span’s tokens, and its width, so the decision has both local edges and whole-span evidence. What changes when the candidate is not one span but a relation?
-
Relations are directed pairs, and events reuse them: Take “Alice works at Acme.” A relation candidate is not just “Alice and Acme”; it is an ordered pair, so swapping the two spans gives a different candidate and can represent a different direction. The pair representation also looks at the tokens between the spans, which can carry relation clues. Events use the same shapes: first find a trigger span, then treat an argument as a span and its role as a relation from trigger to argument. This is a practical reuse of span and pair decisions, not a guarantee that a missed trigger can be recovered downstream.
So the real question is not whether every task has identical labels, but whether each task can be expressed as a typed choice over the right candidate shape. Here, the choice is shared in form while the candidate changes from span to ordered pair. The separate topic of calibration addresses how null probability is used when selecting predictions.
Read the deep dive
Why People Wanted It
A conventional extractor has to learn its labels as part of its model. That makes a new schema awkward: you want to ask for different entity or relation types without rebuilding the whole prediction setup. The real question is whether the schema can participate in reading the text, rather than being bolted on after a generic representation has already been made.
Structured extraction also has different-shaped decisions. An entity or event trigger is a span; a relation connects two spans in a direction. Can one model treat these as related choices while still allowing the answer to be “none of the queried types”?
The Core Move
Encode the text and the queried type names (and optional descriptions) together, let type representations and candidate representations interact, then score each span or ordered span pair over the queried types plus a null class.
For a candidate , the decision is a distribution over , where is the set of queried types and means null. No additional formula is needed to state the core move: the source describes the decision this way, and gives the scoring details below.
Why Types and Candidates Attend to Each Other
Now the version for readers who want more of the machinery: the interaction layer is not just a shared encoder; it explicitly lets the queried types and candidate spans exchange information before scoring. Each type or candidate starts with a representation, and a learned embedding indicates whether it is a null, type, or span item. The sequence passes through pre-norm Transformer blocks with full self-attention and no position information. The resulting type vector can therefore reflect the other queried types and overlapping candidates, while a candidate vector can reflect the schema around it.
This interaction matters when the same text span could plausibly fit related labels: the score is conditioned on the other choices present in this instance, not only on the span in isolation. The source states the attention setup, but does not give a standalone equation for this interaction. What should the final decision do with those contextualized representations?
Why a Span Decision Has a Null Class
Here is the part that gets technical: a candidate span makes exactly one class choice from the null class and the queried types whose annotation status is known. The entity score uses a bilinear form between a projected span representation and a projected type representation, plus a learned bias; the null score depends on the span through a learned null vector. A softmax turns those logits into the class distribution.
A span representation combines its first and last token representations, the mean of its tokens, and a width embedding. This is the scoring target’s geometry: boundary evidence, span-wide evidence, and length information meet before the type decision. Some spans can carry more than one gold type, such as a coarse and a fine type; training maximizes their total probability. Unknown types are omitted from the decision rather than treated as absent. Why does the same idea need a different candidate shape for relations?
Why Relations and Events Reuse the Same Decision Pattern
For readers who want the deeper connection: a relation candidate is an ordered pair of distinct entity spans. Its representation combines the two span vectors, their element-wise product, and the mean of the tokens between them (zero when there are none). It then makes one choice among “no relation” and the queried relation types, using its own interaction layer and bilinear scoring setup. Because the pair is ordered, reversing the spans creates a different candidate and can express the opposite direction.
Events are represented through the same span and pair decisions rather than a separate output form. First, event types are queried as entity types and trigger spans are predicted. For arguments, event types and roles are queried: argument spans are entity decisions, and each trigger-to-argument pair is a relation decision labelled with a role. At inference, triggers are predicted first, then a second pass proposes arguments and assigns roles to trigger-span pairs. This reuses the decision shapes, but leaves a practical dependency: what happens to argument proposals when a trigger is missed?
Minimal Causal Code
This loop shows the visible decision shape, not the model’s attention or bilinear scoring. The logits_for function stands in for those learned components.
import torch
# Each candidate gets logits for null plus the queried types.
for candidate in candidates:
logits = logits_for(candidate, queried_types)
probabilities = torch.softmax(logits, dim=-1)
choice = probabilities.argmax(dim=-1)
if choice == 0:
prediction = None
else:
prediction = queried_types[choice - 1]
What You Gain, and What You Lose
The schema is part of the encoding and candidate interaction, so the model can make decisions relative to the types requested for that instance. A shared span/pair decision pattern also gives entities, relations, triggers, and arguments a common structure, with null as an explicit outcome.
The setup still depends on candidate construction: spans are bounded by a maximum width, and relation decisions operate on ordered pairs of entity spans. Event arguments are proposed after trigger prediction, so the second stage depends on the first. And adding a null class does not by itself solve how to select candidates at inference; thresholding and calibration are a separate concern.
The schema is not just a list of labels: it joins the text in shaping span and pair decisions, each with an explicit way to say “none.”