SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.04618 · NeurIPS · 2023

Revisiting Out-of-distribution Robustness in NLP: Benchmark, Analysis, and LLMs Evaluations

Maosong Sun, Zhiyuan Liu, Ganqu Cui, Lifan Yuan, Yangyi Chen, Hongcheng Gao, Fangyuan Zou, Xingyi Cheng, Ji Heng

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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; 1 failure of our instrument; 1 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/2306.04618.json · badge: /api/ran/2306.04618.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
lifan-yuan/ood_nlp canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
lifan-yuan/OOD_NLP canonical (classifier label)
classifier basis: census
1 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_stat Ran
ran on a synthesized input
lifan-yuan/OOD_NLP/src/dataset_selection/stat.py
code served (permissive licence) · get_code("a61a914b5ecdcc7b")
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 os
import json
import tempfile
import numpy as np
import pandas as pd

# Create temporary directory structure with mock data
temp_dir = tempfile.mkdtemp()

# Create SentimentAnalysis dataset
sentiment_dir = os.path.join(temp_dir, 'sentiment')
os.makedirs(sentiment_dir, exist_ok=True)

train_df = pd.DataFrame({
    'text': ['this is great', 'i love this movie', 'amazing performance'],
    'label': [1, 1, 1]
})
train_df.to_csv(os.path.join(sentiment_dir, 'train.tsv'), sep='\t', index=False, header=False)

test_df = pd.DataFrame({
    'text': ['not good', 'terrible experience'],
    'label': [0, 0]
})
test_df.to_csv(os.path.join(sentiment_dir, 'test.tsv'), sep='\t', index=False, header=False)

# Create NaturalLanguageInference dataset
nli_dir = os.path.join(temp_dir, 'nli')
os.makedirs(nli_dir, exist_ok=True)

train_nli = pd.DataFrame({
    'premise': ['a cat is sitting', 'dogs are animals'],
    'hypothesis': ['there is a cat', 'animals include dogs'],
    'label': [1, 1]
})
train_nli.to_csv(os.path.join(nli_dir, 'train.tsv'), sep='\t', index=False, header=False)

test_nli = pd.DataFrame({
    'premise': ['it is raining'],
    'hypothesis': ['the weather is wet'],
    'label': [1]
})
test_nli.to_csv(os.path.join(nli_dir, 'test.tsv'), sep='\t', index=False, header=False)

# Create NameEntityRecognition dataset
ner_dir = os.path.join(temp_dir, 'ner')
os.makedirs(ner_dir, exist_ok=True)

with open(os.path.join(ner_dir, 'train.tsv'), 'w') as f:
    f.write("John\tPER\nis\tO\nhere\tO\n\nParis\tLOC\nis\tO\n")

with open(os.path.join(ner_dir, 'test.tsv'), 'w') as f:
    f.write("Mary\tPER\nwent\tO\n")

# Create QuestionAnswering dataset
qa_dir = os.path.join(temp_dir, 'qa')
os.makedirs(qa_dir, exist_ok=True)

with open(os.path.join(qa_dir, 'train.json'), 'w') as f:
    f.write('{"context": "the quick brown fox jumps over the lazy dog", "question": "what jumps", "answer": "fox"}\n')
    f.write('{"context": "paris is the capital of france", "question": "capital of france", "answer": "paris"}\n')

with open(os.path.join(qa_dir, 'test.json'), 'w') as f:
    f.write('{"context": "london is a big city", "question": "what is london", "answer": "city"}\n')

# Create CommonSense dataset
cs_dir = os.path.join(temp_dir, 'commonsense')
os.makedirs(cs_dir, exist_ok=True)

train_cs = pd.DataFrame({
    'context': ['what do you do when cold', 'how to stay warm'],
    'question': ['action', 'method'],
    'option': ["['shiver', 'wear coat']", "['move around', 'drink hot tea']"],
    'label': [1, 0]
})
train_cs.to_csv(os.path.join(cs_dir, 'train.tsv'), sep='\t', index=False, header=False)

test_cs = pd.DataFrame({
    'context': ['winter weather'],
    'question': ['season'],
    'option': ["['cold', 'snowy']"],
    'label': [0]
})
test_cs.to_csv(os.path.join(cs_dir, 'test.tsv'), sep='\t', index=False, header=False)

ARGS = {
    'path': sentiment_dir,
    'task_name': 'SentimentAnalysis',
    'dataset_name': 'TestSentiment'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
label_process Ran
ran, honoured the contract we drafted
lifan-yuan/ood_nlp/src/dataset_processing/SentimentAnalysis/amazon.py
code served (permissive licence) · get_code("3179cf13aba13799")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, 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.

ARGS = {
    "label": 3
}
Setup block drafted by
a language model, Claude Sonnet 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 int, ndim 0, dtype family int, 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
text_process Ran
ran; our contract draft was wrong, not the code
lifan-yuan/ood_nlp/src/dataset_processing/SentimentAnalysis/amazon.py
code served (permissive licence) · get_code("7a5434e80b0662b1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    "text": "This is\ta test  string   with\t\ttabs and    multiple   spaces"
}
Setup block drafted by
a language model, Claude Sonnet 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 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
main Not yet run
unverified (harvested, no recorded run)
lifan-yuan/OOD_NLP/src/evaluations/llm.py
code served (permissive licence) · get_code("32eb6c58d201b588")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 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.

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

This paper reexamines the research on out-of-distribution (OOD) robustness in the field of NLP. We find that the distribution shift settings in previous studies commonly lack adequate challenges, hindering the accurate evaluation of OOD robustness. To address these issues, we propose a benchmark construction protocol that ensures clear differentiation and challenging distribution shifts. Then we introduce BOSS, a Benchmark suite for Out-of-distribution robustneSS evaluation covering 5 tasks and 20 datasets. Based on BOSS, we conduct a series of experiments on pretrained language models for analysis and evaluation of OOD robustness. First, for vanilla fine-tuning, we examine the relationship between in-distribution (ID) and OOD performance. We identify three typical types that unveil the inner learning mechanism, which could potentially facilitate the forecasting of OOD robustness, correlating with the advancements on ID datasets. Then, we evaluate 5 classic methods on BOSS and find that, despite exhibiting some effectiveness in specific cases, they do not offer significant improvement compared to vanilla fine-tuning. Further, we evaluate 5 LLMs with various adaptation paradigms and find that when sufficient ID data is available, fine-tuning domain-specific models outperform LLMs on ID examples significantly. However, in the case of OOD instances, prioritizing LLMs with in-context learning yields better results. We identify that both fine-tuned small models and LLMs face challenges in effectively addressing downstream tasks. The code is public at https://github.com/lifan-yuan/OOD_NLP.

For agents

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

get_harvested_code_for_paper("2306.04618")
get_code_for_paper("2306.04618")
have("2306.04618")

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

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

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

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

Connect an agent — have() is free.