Papers › Learning to Encode Position for Transformer with Continuous Dynamical Model

Learning to Encode Position for Transformer with Continuous Dynamical Model

13 Mar 2020ICML 2020 1arXiv:2003.09229archive 2025-07-28

Xuanqing Liu, Hsiang-Fu Yu, Inderjit Dhillon, Cho-Jui Hsieh

We introduce a new way of learning to encode position information for non-recurrent models, such as Transformer models. Unlike RNN and LSTM, which contain inductive bias by loading the input tokens sequentially, non-recurrent models are less sensitive to position. The main reason is that position information among input units is not inherently encoded, i.e., the models are permutation equivalent; this problem justifies why all of the existing models are accompanied by a sinusoidal encoding/embedding layer at the input. However, this solution has clear limitations: the sinusoidal encoding is not flexible enough as it is manually designed and does not contain any learnable parameters, whereas the position embedding restricts the maximum length of input sequences. It is thus desirable to design a new position layer that contains learnable parameters to adjust to different datasets and different architectures. At the same time, we would also like the encodings to extrapolate in accordance with the variable length of inputs. In our proposed solution, we borrow from the recent Neural ODE approach, which may be viewed as a versatile continuous version of a ResNet. This model is capable of modeling many kinds of dynamical systems. We model the evolution of encoded results along position index by such a dynamical system, thereby overcoming the above limitations of existing methods. We evaluate our new position layers on a variety of neural machine translation and language understanding tasks, the experimental results show consistent improvements over the baselines.

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="2003.09229")

Code

Syntology Ran 3 of 6 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 1 ran with no contract checked.

By repository: community (archive-listed): 4 samples from 1 repository, 1 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.

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

6 samples harvested; 3 ran; 0 honoured the contract we drafted; 3 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.

2ran · our draft was wrong
1ran
3unverified

Licence: 6 of the 6 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 xuanqing94/FLOATER. 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.

safe_readline xuanqing94/FLOATER/fairseq/binarizer.py community (archive-listed) ran MIT recorded; this copy not marked cleared · pointer only · 82bdf940665aeeb4 · report
load_checkpoint xuanqing94/FLOATER/fairseq/checkpoint_utils.py community (archive-listed) unverified MIT recorded; this copy not marked cleared · pointer only · ecf5bbfd1a093f93 · report
load_checkpoint_to_cpu xuanqing94/FLOATER/fairseq/checkpoint_utils.py community (archive-listed) unverified MIT recorded; this copy not marked cleared · pointer only · df40d96cc20e7f57 · report
save_checkpoint xuanqing94/FLOATER/fairseq/checkpoint_utils.py community (archive-listed) unverified MIT recorded; this copy not marked cleared · pointer only · b3616a62387703cb · report
Embedding identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 96cbb5e9ca5b6be0 · report
Linear identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 8cd8cb0d1e9e63e4 · report

Tasks

Inductive BiasLinguistic AcceptabilityMachine TranslationSemantic Textual SimilaritySentiment Analysis

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Linguistic Acceptability CoLA FLOATER-large Accuracy 69% #16 of 43 Archive leaderboard report
Machine Translation WMT2014 English-French FLOATER-large BLEU score 42.7 #16 of 57 Archive leaderboard report
Machine Translation WMT2014 English-German FLOATER-large BLEU score 29.2 #29 of 91 Archive leaderboard report
Semantic Textual Similarity MRPC FLOATER-large Accuracy 91.4% #5 of 45 Archive leaderboard report
Sentiment Analysis SST-2 Binary classification FLOATER-large Accuracy 96.7 #11 of 87 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

1x1 ConvolutionAbsolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerReLUResidual ConnectionSoftmaxTransformer

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