Papers › Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context

Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context

9 Jan 2019ACL 2019 7arXiv:1901.02860archive 2025-07-28

Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, Ruslan Salakhutdinov

Transformers have a potential of learning longer-term dependency, but are limited by a fixed-length context in the setting of language modeling. We propose a novel neural architecture Transformer-XL that enables learning dependency beyond a fixed length without disrupting temporal coherence. It consists of a segment-level recurrence mechanism and a novel positional encoding scheme. Our method not only enables capturing longer-term dependency, but also resolves the context fragmentation problem. As a result, Transformer-XL learns dependency that is 80% longer than RNNs and 450% longer than vanilla Transformers, achieves better performance on both short and long sequences, and is up to 1,800+ times faster than vanilla Transformers during evaluation. Notably, we improve the state-of-the-art results of bpc/perplexity to 0.99 on enwiki8, 1.08 on text8, 18.3 on WikiText-103, 21.8 on One Billion Word, and 54.5 on Penn Treebank (without finetuning). When trained only on WikiText-103, Transformer-XL manages to generate reasonably coherent, novel text articles with thousands of tokens. Our code, pretrained models, and hyperparameters are available in both Tensorflow and PyTorch.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1901.02860")

Code

Syntology Ran 63 of 143 code samples harvested from 20 repositories linked to this paper; 80 have no recorded run. Of those that ran: 4 ran · honoured contract; 1 ran · violated contract; 6 ran · our draft was wrong; 12 ran · fixture could not drive it; 40 ran with no contract checked.

By repository: official repository: 13 samples from 1 repository, 8 ran; community (archive-listed): 128 samples from 19 repositories, 53 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

37 repositories listed; official and paper-mentioned ones first.

kimiyoung/transformer-xl officialmentioned in papermentioned on GitHubpytorch report
Jmkernes/PAR-Transformer-XL mentioned on GitHubtf report
Machine-Learning-Tokyo/Poetry-GAN mentioned on GitHubMIT report
SambhawDrag/XLNet.jl mentioned on GitHubpytorch report
TimDettmers/transformer-xl mentioned on GitHubpytorchApache-2.0 report
aiha-lab/Attention-Head-Pruning mentioned on GitHubpytorchGPL-3.0 report
cedrickchee/pytorch-pretrained-BERT mentioned on GitHubpytorch report
cmunnis/BERT_vs_Transformer-XL mentioned on GitHubpytorch report
google-research/meliad mentioned on GitHubjaxApache-2.0 report
huggingface/transformers mentioned on GitHubpytorch report
huggingface/xlnet mentioned on GitHubtf report
inzva/fake-academic-paper-generation mentioned on GitHubpytorch report
listenviolet/XLNet mentioned on GitHubpytorch report
mustafaaljadery/gemma-2b-10m mentioned on GitHubpytorch report
okkteam/Transformer-Transducer mentioned on GitHubpytorch report
park-cheol/ASR-Conformer mentioned on GitHubpytorch report
samwisegamjeee/pytorch-transformers mentioned on GitHubpytorchApache-2.0 report
sh951011/Attention-Implementation mentioned on GitHubpytorchMIT report
sooftware/Attention-Implementation mentioned on GitHubpytorch report
sooftware/attentions mentioned on GitHubpytorchMIT report
sooftware/conformer mentioned on GitHubpytorch report
sooftware/nlp-attentions mentioned on GitHubpytorchMIT report
wxt1997/Transformer-Transducer mentioned on GitHubpytorch report
zhdbwe/Paper-DailyReading mentioned on GitHubtf report
lvyufeng/bert4ms mindsporeApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

143 samples harvested; 63 ran; 4 honoured the contract we drafted; 80 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · honoured contract
1ran · violated contract
6ran · our draft was wrong
12ran · fixture could not drive it
40ran
80unverified

Licence: 43 of the 143 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 20 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AdaptiveEmbedding kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 1ae137f0cee15e33 · report
DecoderLayer kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · e8aac29a19d0c2e7 · report
LogUniformSampler kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran Apache-2.0 (permissive) · 220657028509cfb1 · report
MultiHeadAttn kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · d99c9cc9af9de483 · report
PositionwiseFF kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · c96fba039a607703 · report
ProjectedAdaptiveLogSoftmax kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 338c39719307318d · report
RelMultiHeadAttn kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · fe28ba867add05c0 · report
sample_logits kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 93228a3eb5c4d179 · report
MemTransformerLM kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository unverified Apache-2.0 (permissive) · 9ef2fc89678fefb2 · report
RelLearnableDecoderLayer kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository unverified Apache-2.0 (permissive) · 17ee18e7e701439f · report
RelLearnableMultiHeadAttn kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository unverified Apache-2.0 (permissive) · a033a134e9f6452f · report
RelPartialLearnableDecoderLayer kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository unverified Apache-2.0 (permissive) · 89afd0bff30e18a9 · report
RelPartialLearnableMultiHeadAttn kimiyoung/transformer-xl/pytorch/mem_transformer.py official repository unverified Apache-2.0 (permissive) · fb613dd5bc21371c · report
AdaptiveEmbedding cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · e77541c1b4b15830 · report
AdaptiveEmbedding NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 8a8691f05cb1b5da · report
Attention facebookresearch/code-prediction-transformer/model.py community (archive-listed) ran licence not identified · pointer only · e3217ee8bd314909 · report
Block facebookresearch/code-prediction-transformer/model.py community (archive-listed) ran licence not identified · pointer only · 548da299b3bc04e9 · report
GEGLU shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted Apache-2.0 (permissive) · 845f84e3a319753d · report
GPT2Model facebookresearch/code-prediction-transformer/model.py community (archive-listed) ran licence not identified · pointer only · 72ccb5501088c2b4 · report
GatoInputBase shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 6a748d270690866b · report
GemmaConfig mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) ran no licence file found · pointer only · 709b8a145b15f0ca · report
GemmaRotaryEmbedding mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 39c5be8f7b1c0490 · report
ICTaskInput shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · ad41eff0feadfd69 · report
LayerNorm facebookresearch/code-prediction-transformer/model.py community (archive-listed) ran licence not identified · pointer only · 39480331817170e8 · report
Linear park-cheol/ASR-Conformer/model/attention.py community (archive-listed) ran · metamorphic tier: invariant no licence file found · pointer only · 84585e9be4407fc4 · report
MLP facebookresearch/code-prediction-transformer/model.py community (archive-listed) ran licence not identified · pointer only · df5a6cf54dd0aca6 · report
MultiHeadAttn NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · e672e8a20905b62b · report
MultiHeadedAttention okkteam/Transformer-Transducer/tt/transformer/attention.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 5597fd8e1219b866 · report
NLPTaskInput shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 7eb33bec45fe09f3 · report
PatchEmbeddings shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · b54068382071f8c8 · report
PathLSTM facebookresearch/code-prediction-transformer/model.py community (archive-listed) ran licence not identified · pointer only · 5fb8aacfbced509d · report
PositionalEmbedding shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 142586d370dc7c1e · report
PositionalEmbedding cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 06ce2b899569db5b · report
PositionalEncoding AIResearchHub/transformergallery/transformer/transformerxl.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted MIT (permissive) · 07bf8cf6e731d1bc · report
PositionwiseFF shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · eed8c286b97219b7 · report
ProjectedAdaptiveLogSoftmax NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 4088ee884194d7c4 · report
ProjectedAdaptiveLogSoftmax inzva/fake-academic-paper-generation/transformer-xl/pytorch/mem_transformer.py community (archive-listed) ran MIT (permissive) · 7d9e9736e6c57d11 · report
RLTaskInput shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 2e57dbd19f63d3f4 · report
RelMultiHeadAttention Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran no licence file found · pointer only · 4c8b264bb79a35a1 · report
RelMultiHeadAttn NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 8fa37260188b5fd8 · report
RelPositionMultiHeadedAttention okkteam/Transformer-Transducer/tt/transformer/attention.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 4977fa89216a56fa · report
RelativeMultiHeadAttention park-cheol/ASR-Conformer/model/attention.py community (archive-listed) ran · metamorphic tier: invariant no licence file found · pointer only · 032b78da6979837c · report
TransfoXLConfig cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · a97a22ac6fb31922 · report
TransformerEmbedding AIResearchHub/transformergallery/transformer/transformerxl.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · c7b5eb55f15a37de · report
VQATaskInput shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 2a023fc4bac8d229 · report
VisionEmbedding shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 2a5f4bac2414eb0f · report
_cache_mem benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 773651748c9618d6 · report
_cache_mem huggingface/xlnet/modeling.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 9d5e914b24b8911a · report
build_normalization opendilab/DI-engine/ding/torch_utils/network/transformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · c92e4fc990bba2fe · report
build_tf_to_pytorch_map cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 35ef111fc00c21b4 · report
create_lookahead_mask Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran · honoured contract no licence file found · pointer only · 499bf5fee7915c78 · report
embedding_lookup benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 9109ba9791e44324 · report
fc_block opendilab/DI-engine/ding/torch_utils/network/transformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · c1184d27672a7461 · report
left_shift Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · 8d59a6d5900428f5 · report
positional_embedding benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · d50e8679cde3a927 · report
positional_embedding huggingface/xlnet/modeling.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 9bf0f6e6298f3fbe · report
positional_encoding Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · 2398c4a5c285bdc4 · report
positionwise_ffn Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · f7a746d73ab2f28c · report
rel_shift benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · d37883dc58ff9b69 · report
rel_shift huggingface/xlnet/modeling.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 5f7c5b38aeb29bf5 · report
relative_position_logits Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · edeef97857b7cdca · report
relative_positional_encoding huggingface/xlnet/modeling.py community (archive-listed) ran · honoured contract Apache-2.0 (permissive) · 8e76562720b0c921 · report
repeat_kv mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · 4e762613ee907cdb · report
right_shift Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · df4647a6d9f03c0e · report
rotate_half mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · cec833a99feb528c · report
sequential_pack opendilab/DI-engine/ding/torch_utils/network/transformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · a4f0d0fb0e45662a · report
AdaptiveSoftmax Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) unverified no licence file found · pointer only · 87202268910cb496 · report
Attention opendilab/DI-engine/ding/torch_utils/network/transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · fe3454282cf0b88e · report
DecoderLayer cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · fc52846dc775edff · report
DecoderLayer NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · c614edf5b8c0d3b0 · report
GPT2LMHead facebookresearch/code-prediction-transformer/model.py community (archive-listed) unverified licence not identified · pointer only · 117b06ce2fbc7877 · report
GemmaAttention mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) unverified no licence file found · pointer only · e4e12108c18eb032 · report
GemmaInfiniAttention mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) unverified no licence file found · pointer only · de07f82e734e3e2c · report
MemTransformerLM NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · 5ffa84d26ba39532 · report
MemTransformerLM inzva/fake-academic-paper-generation/transformer-xl/pytorch/mem_transformer.py community (archive-listed) unverified MIT (permissive) · a7430322070cedb5 · report
MemTransformerLM jincan333/lot/model/mem_transformer.py community (archive-listed) unverified MIT (permissive) · 12dd38874c15490a · report
MultiHeadAttn cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · d4857f57ecefa3d5 · report
PARTransformerXL Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) unverified no licence file found · pointer only · de3ab66ec62fc167 · report
PositionwiseFF cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 62b1b4ab79fdfc8b · report
ProjectedAdaptiveLogSoftmax jincan333/lot/model/mem_transformer.py community (archive-listed) unverified MIT (permissive) · 6b820cc9aac66bc1 · report
RelLearnableDecoderLayer cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 752529d23a4b3b22 · report
RelLearnableDecoderLayer NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · ea7c8500cbc85ff5 · report
RelLearnableMultiHeadAttn cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 3dafbc50941af43d · report
RelLearnableMultiHeadAttn NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · cb862dd19b1f381a · report
RelMultiHeadAttn cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · dc7c9e91c34d6ddf · report
RelPartialLearnableDecoderLayer shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 9ec384a6bfe40952 · report
RelPartialLearnableDecoderLayer cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · fd8d58e6a1428332 · report
RelPartialLearnableDecoderLayer NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · 5014b04d3358c101 · report
RelPartialLearnableMultiHeadAttn shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · fdc345d0da45dd95 · report
RelPartialLearnableMultiHeadAttn cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 8361fa24d3e06e13 · report
RelPartialLearnableMultiHeadAttn NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · 5e1b71bde76b69e7 · report
RelativeMultiHeadAttention sooftware/Attention-Implementation/attentions.py community (archive-listed) unverified MIT (permissive) · c018d465b6253b94 · report
RelativeMultiHeadAttention sooftware/conformer/conformer/attention.py community (archive-listed) unverified Apache-2.0 (permissive) · 274ae09f88dbb42a · report
RelaxedOneHot Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) unverified no licence file found · pointer only · 1be1a875d12d10b3 · report
StochasticBlock Jmkernes/PAR-Transformer-XL/par_model.py community (archive-listed) unverified no licence file found · pointer only · 534b6317f069c394 · report
TransfoXLModel cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 532a59e61c71b7a8 · report
TransfoXLPreTrainedModel cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · d7bd7d30264b3658 · report
TransformerLayer opendilab/DI-engine/ding/torch_utils/network/transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · b28585d20fefea46 · report
TransformerModel facebookresearch/code-prediction-transformer/model.py community (archive-listed) unverified licence not identified · pointer only · 9a2f71717dcf3962 · report
TransformerXL shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · a2315dc06271216b · report
TransformerXL AIResearchHub/transformergallery/transformer/transformerxl.py community (archive-listed) unverified MIT (permissive) · fa690903d5ea5d89 · report
XLAttentionLayer AIResearchHub/transformergallery/transformer/transformerxl.py community (archive-listed) unverified MIT (permissive) · 91e5af7605c83b9a · report
XLNet listenviolet/XLNet/xlnet.py community (archive-listed) unverified Apache-2.0 (permissive) · 2b646a664c00ffa8 · report
_create_mask benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · ed15761e38990647 · report
_create_mask huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · c1f8a649a7a837d5 · report
apply_rotary_pos_emb mustafaaljadery/gemma-2b-10m/src/gemma.py community (archive-listed) unverified no licence file found · pointer only · 5c61a4c30ce59547 · report
assign_to_gpu TimDettmers/transformer-xl/tf/gpu_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 6b2a8f1c93d0b071 · report
average_grads_and_vars TimDettmers/transformer-xl/tf/gpu_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 0e3f1e158da4c3b8 · report
batchify TimDettmers/transformer-xl/tf/data_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 36eed0b265968be7 · report
cached_path cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 6fee57012e68e835 · report
checkpoint_exists TimDettmers/transformer-xl/tf/avg_checkpoints.py community (archive-listed) unverified Apache-2.0 (permissive) · e505aeb6374f0f1c · report
create_ordered_tfrecords TimDettmers/transformer-xl/tf/data_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 48246428164ddbc5 · report
embedding_lookup huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · 5abf0267f0fc7514 · report
generate_per_core_enqueue_ops_fn_for_host TimDettmers/transformer-xl/tf/tpu_estimator.py community (archive-listed) unverified Apache-2.0 (permissive) · f07d3c5f67c9a93d · report
generate_per_host_enqueue_ops_fn_for_host TimDettmers/transformer-xl/tf/tpu_estimator.py community (archive-listed) unverified Apache-2.0 (permissive) · d5a05e8b3b59f012 · report
generate_per_host_v2_enqueue_ops_fn_for_host TimDettmers/transformer-xl/tf/tpu_estimator.py community (archive-listed) unverified Apache-2.0 (permissive) · 8ca3ba583d69ea38 · report
get_bin_sizes TimDettmers/transformer-xl/tf/data_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · ab8eff277d0925e9 · report
get_from_cache cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · b4bb49d2de702f67 · report
head_projection huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · 6804d62cb7cd8df3 · report
lm_loss Machine-Learning-Tokyo/Poetry-GAN/textgan.py community (archive-listed) unverified MIT (permissive) · c1c98338b80e7459 · report
load_from_checkpoint TimDettmers/transformer-xl/tf/gpu_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 3d6b054785523852 · report
load_tf_weights_in_transfo_xl cedrickchee/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling_transfo_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · 1ebc2bf2c3cddc4d · report
mask_adaptive_embedding_lookup benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · 99e35dc770639097 · report
mask_adaptive_logsoftmax benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · fca4d6d03913ae24 · report
mul_adaptive_embedding_lookup benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · 8d07f1308bd24cbc · report
mul_adaptive_logsoftmax benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · e344186184b46850 · report
positionwise_FF benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · 3652bf001c221967 · report
positionwise_ffn huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · ddf11fc956cd28ce · report
post_attention huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · cf208c8c20d52c1b · report
post_process Machine-Learning-Tokyo/Poetry-GAN/lang_model.py community (archive-listed) unverified MIT (permissive) · 9d6735f22035b700 · report
print_with_rank shanghai-digital-brain-laboratory/bdm-db1/src/model/transformer_xl.py community (archive-listed) unverified Apache-2.0 (permissive) · bf75653cc30018e0 · report
rel_attn_core huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · b517847a8c809203 · report
rel_multihead_attn benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · b1f1afea05cd968b · report
rel_multihead_attn huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · 6ccb8d28491109b6 · report
sample_logits NVIDIA/DeepLearningExamples/PyTorch/LanguageModeling/Transformer-XL/pytorch/mem_transformer.py community (archive-listed) unverified no licence file found · pointer only · 582150577e5bd769 · report
scatter TimDettmers/transformer-xl/pytorch/utils/data_parallel.py community (archive-listed) unverified Apache-2.0 (permissive) · 69598ced7806d8c3 · report
scatter_kwargs TimDettmers/transformer-xl/pytorch/utils/data_parallel.py community (archive-listed) unverified Apache-2.0 (permissive) · aa1de448b0528802 · report
seq_gumbel_softmax Machine-Learning-Tokyo/Poetry-GAN/textgan.py community (archive-listed) unverified MIT (permissive) · e7ebaba541ff0216 · report
transformer benkrause/dynamiceval-transformer/tf/model.py community (archive-listed) unverified Apache-2.0 (permissive) · d0f56431ab6c3b37 · report
transformer_xl huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · d077730400326171 · report
two_stream_rel_attn huggingface/xlnet/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · 2d935f29546db9cd · report
add_and_scale identical code first harvested elsewhere ran · fixture could not drive it licence of this copy not recorded · 78d91efd74e4d12a · report
to_2tuple identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 4e978f9f7835b10a · report

Tasks

ArticlesLanguage ModelingLanguage Modelling

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Language Modelling Hutter Prize 24-layer Transformer-XL Bit per Character (BPC) 0.99 #4 of 18 Archive leaderboard report
Language Modelling Hutter Prize 24-layer Transformer-XL Number of params 277M #4 of 18 Archive leaderboard report
Language Modelling Hutter Prize 18-layer Transformer-XL Bit per Character (BPC) 1.03 #7 of 18 Archive leaderboard report
Language Modelling Hutter Prize 18-layer Transformer-XL Number of params 88M #7 of 18 Archive leaderboard report
Language Modelling Hutter Prize 12-layer Transformer-XL Bit per Character (BPC) 1.06 #9 of 18 Archive leaderboard report
Language Modelling Hutter Prize 12-layer Transformer-XL Number of params 41M #9 of 18 Archive leaderboard report
Language Modelling One Billion Word Transformer-XL Large Number of params 0.8B #4 of 27 Archive leaderboard report
Language Modelling One Billion Word Transformer-XL Large PPL 21.8 #4 of 27 Archive leaderboard report
Language Modelling One Billion Word Transformer-XL Base Number of params 0.46B #8 of 27 Archive leaderboard report
Language Modelling One Billion Word Transformer-XL Base PPL 23.5 #8 of 27 Archive leaderboard report
Language Modelling Penn Treebank (Word Level) Transformer-XL Params 24M #22 of 43 Archive leaderboard report
Language Modelling Penn Treebank (Word Level) Transformer-XL Test perplexity 54.55 #22 of 43 Archive leaderboard report
Language Modelling Penn Treebank (Word Level) Transformer-XL Validation perplexity 56.72 #22 of 43 Archive leaderboard report
Language Modelling Text8 Transformer-XL - 24 layers Bit per Character (BPC) 1.08 #5 of 24 Archive leaderboard report
Language Modelling Text8 Transformer-XL - 24 layers Number of params 277M #5 of 24 Archive leaderboard report
Language Modelling WikiText-103 Transformer-XL Large Number of params 257M #34 of 89 Archive leaderboard report
Language Modelling WikiText-103 Transformer-XL Large Test perplexity 18.3 #34 of 89 Archive leaderboard report
Language Modelling WikiText-103 Transformer-XL Large Validation perplexity 18.2 #34 of 89 Archive leaderboard report
Language Modelling WikiText-103 Transformer-XL Standard Number of params 151M #54 of 89 Archive leaderboard report
Language Modelling WikiText-103 Transformer-XL Standard Test perplexity 24.0 #54 of 89 Archive leaderboard report
Language Modelling WikiText-103 Transformer-XL Standard Validation perplexity 23.1 #54 of 89 Archive leaderboard report
Language Modelling enwik8 Transformer-XL (24 layers) Bit per Character (BPC) 0.99 #12 of 42 Archive leaderboard report
Language Modelling enwik8 Transformer-XL (24 layers) Number of params 277M #12 of 42 Archive leaderboard report
Language Modelling enwik8 Transformer-XL (18 layers) Bit per Character (BPC) 1.03 #23 of 42 Archive leaderboard report
Language Modelling enwik8 Transformer-XL (18 layers) Number of params 88M #23 of 42 Archive leaderboard report
Language Modelling enwik8 Transformer-XL (12 layers) Bit per Character (BPC) 1.06 #26 of 42 Archive leaderboard report
Language Modelling enwik8 Transformer-XL (12 layers) Number of params 41M #26 of 42 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: Transformer-XL

AdamAdaptive Input RepresentationsAdaptive SoftmaxAttentionCosine AnnealingDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionReLUResidual ConnectionSoftmaxTransformer-XLVariational Dropout

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections