Elapsed Time as Position: Reusing a Language Model's Rotary Prior on Irregular Sequences

Language models pretrained on text turn out to be good starting points for non-language sequences. Initializing a forecaster or an offline control policy from text weights speeds learning several-fold and helps most when data is scarce. Every one of these results, however, assumes that observations arrive like the ticks of a metronome, one token per fixed step. Real clinical records, event logs and sensor streams arrive at irregular times. The one systematic study of language models on irregular clinical data found that text pretraining bought essentially nothing there: it lost to a small specialized model at fourteen times the training cost. We propose a minimal and testable explanation, and a fix that follows from it. Many modern language models encode token order with rotary position embeddings (RoPE). RoPE rotates query and key vectors by an angle proportional to each token's position, so attention depends only on the offset between two tokens. RoPE is a continuous function of position. Nothing stops us from feeding it rescaled elapsed time instead of an integer index.

The core claim is that substituting warped elapsed time for token index in a RoPE-pretrained model carries the pretrained sequential prior over to irregularly sampled sequences, and adds no new positional parameters. In particular, the attention heads that learned during text pretraining to weight nearby tokens over distant ones should keep doing so, with "nearby" now meaning "recent in time." The proposal is less a new architecture than a controlled test of a specific transfer hypothesis. The test hinges on an interaction. If time-as-position helps a pretrained model much more than it helps the same model from random initialization, the gain comes from reused pretrained structure and not merely from a better time encoding.

What exists and what is missing

Pretrained-language-model transfer to sequences is well established on regular grids. Can Wikipedia Help Offline Reinforcement Learning? fine-tunes GPT-2 and a Wikipedia-trained model on offline RL trajectories and reports a 3–6x training speedup over Decision Transformers trained from scratch. A Decision Transformer is a model that predicts actions autoregressively, conditioned on desired future return. Unleashing the Power of Pre-trained Language Models for Offline Reinforcement Learning (LaMo) adds low-rank adapters (LoRA), multilayer-perceptron input projections and an auxiliary language loss, and argues that freezing the backbone beats full fine-tuning. Language Pretraining Gives Structured Forecasters a Sequential Prior adapts Qwen3-0.6B to probabilistic forecasting with 1,024 value bins and reports a 6.8x effective data multiplier. DecisionLLM embeds trajectories through a dedicated encoder to fix numerical insensitivity. These works motivate the proposal and supply its training recipes. All of them use integer positions.

Continuous-time models supply the target behavior but no pretraining. Continuous-Time Decision Transformer for Healthcare Applications (CTDT) adds an interval token, uses sinusoidal time embeddings and treats time-to-next-visit as an action. It is trained from scratch. ContiFormer replaces dot-product attention with integrals over neural-ODE trajectories, which is expressive but costly. Neither tests whether a text prior survives a change of time axis. nD-RoPE shows that rotary encodings extend cleanly to continuous coordinates. We borrow that view, but for one time dimension inside a pretrained model rather than a model trained from scratch.

Two papers constrain the design. Rethinking Large Language Models for Irregular Time Series Classification in Critical Care found that the upstream irregularity-aware encoder, not the language backbone, drives performance. The language model in that work remained a discrete-index model fed by a separate encoder. That leaves open whether pretraining fails on irregular data or whether the time interface did. Our design changes exactly that interface. LAST SToP writes inter-arrival times into the prompt as text. Its authors note that point-process models still predict exact timing better, which warns against routing time through token embeddings.

Core mechanism

Let each observation $i$ carry a timestamp $t_i$ and be represented by $K$ tokens. In forecasting, $K=1$ value token. In control, $K=4$ tokens: return-to-go, state, action and interval, following CTDT. We assign the $j$-th token of observation $i$ the rotary position

$$p_{i,j} = \alpha\,\varphi(t_i - t_0) + j,$$

where $\varphi$ is a monotone warp of elapsed time, either linear or $\log(1+t/\tau)$ with time constant $\tau$, and $\alpha$ is set so that the median inter-observation gap in the training data maps to $K$ position units. With linear $\varphi$ and perfectly regular sampling this reduces to the standard index $p = Ki + j$. The pretrained model is therefore recovered exactly at zero irregularity. Every change in behavior can then be attributed to irregularity itself rather than to a disturbed initialization. The log warp exists because very long gaps would otherwise push offsets beyond the pretraining context. We treat linear versus log as an ablation, not an assumption.

The backbone is Qwen3-0.6B, chosen because it uses RoPE and is the model of the closest forecasting study. GPT-2's learned absolute positions cannot take continuous inputs, so it is excluded by design. For forecasting we keep that study's 1,024-bin tokenizer so that only the positional channel changes. For control we use LaMo-style multilayer-perceptron projections with LoRA and predict the interval as an action, as CTDT does.

Research Program

The work has three parts.

The first is a zero-training probe. In the frozen pretrained model we identify heads whose attention decays with token distance on text. We then measure whether, under time-as-position, their attention on irregular numeric sequences decays with elapsed time rather than with token count. We also repeat the forecasting study's frozen hidden-state retrieval forecast, which that paper reports beating last-value carry-forward by 16%, under integer versus time positions. If frozen heads already track elapsed time, the transfer story has mechanistic support before any fine-tuning.

The second part is the main transfer experiment. Its design crosses two initializations (pretrained, random) with four time interfaces:

  • integer positions only;
  • integer positions plus an interval input token, the CTDT design;
  • interval written as text, the LAST SToP style;
  • time-as-position.

All conditions use the same token budget and are swept across irregularity levels and data fractions.

The third part revisits the freezing dispute under the new interface. We compare full fine-tuning, LoRA on attention, and input/output-only training. The rotary change alters what every attention head sees, so it is plausible that LoRA suffices here even though input/output-only training failed in the Wikipedia study.

Baselines

The naive reference point in forecasting is last-value carry-forward. In control it is behavior cloning, which CTDT reports at 1267.1 days median survival on the DIVAT kidney-transplant simulator. Any method that fails to clear these is not learning temporal structure.

The strongest existing method for continuous-time control is CTDT trained from scratch. On DIVAT it reports 2645.8 days median survival, against 1792.5 days for a vanilla Decision Transformer on discretized time. We re-run CTDT at its published configuration and at a capacity matched to our adapted parameter count, giving both the same offline data and the same hyperparameter-search budget. Beating it means higher median survival over five or more seeds, with non-overlapping confidence intervals, at full data. Alternatively it means matching CTDT's full-data score using 10% of the data, which is where pretraining claims its advantage.

For forecasting, the strongest pretrained competitor is the Tai et al. recipe run unchanged. On regular GiftEval it reports 20.10 CRPS (continuous ranked probability score, a calibration-aware forecast error) at 128 training steps for pretrained LoRA, versus 154.5 for random initialization. No reported result was found on Lacuna for irregularly subsampled GiftEval, so we will establish that number ourselves. The strongest specialized irregular forecaster is ContiFormer. Its reported strength is on spirals and UEA classification, with no reported result on irregular GiftEval found on Lacuna. We run it with an equal tuning budget and report wall-clock alongside accuracy.

The key ablation is the pretrained model with integer positions plus an interval input token. It shares everything with our method except where time enters. Beating it is the claim. It also sharpens the interaction test: the pretrained-minus-random gap should be larger under time-as-position than under the interval token. The random-initialization time-as-position model isolates whether the encoding alone explains the gains.

Why not just…?

Why not just train CTDT or ContiFormer from scratch? At full data this may tie, and we will report it if so. The forecasting study's 154.5 versus 20.10 CRPS gap at 128 steps, and LaMo's report that from-scratch Decision Transformers collapse at 1–10% data, suggest the advantage of pretraining lies in the low-data regime. Our data-fraction sweep measures exactly that regime under irregular sampling, where it has never been measured.

Why not just add elapsed time as an extra input token and keep integer positions? This is the real threat, because it is simpler and CTDT shows it works from scratch. Our argument is that integer positions then tell pretrained heads that a two-hour gap and a two-second gap are the same distance. The model must relearn recency from an input feature, discarding the head structure the transfer is supposed to supply. The head-to-head ablation decides it. If the interval-token variant matches ours at every irregularity level and data fraction, we will conclude that the positional channel does not matter and report that negative result.

Why not just resample onto a uniform grid with imputation? CTDT's own comparison (1792.5 versus 2645.8 days) and the critical-care study's finding that patching degrades toward 90% missingness argue against it. We include grid-plus-forward-fill as a condition so the cost is measured on our tasks, not assumed.

Why not just write timestamps as text, as LAST SToP does? Its authors report that it trails point-process models on exact timing. We test it directly by scoring next-interval error in the control tasks, where timing is an action and errors directly change outcomes.

Why not just use a lightweight specialized model like Warpformer? On PhysioNet 2012 it reached 54.8 AUPRC (area under the precision-recall curve) against 54.0 for the best language-model adaptation, at a fraction of the cost. We do not claim to overturn that on static classification. As a secondary check, we run time-as-position on PhysioNet 2012 against Warpformer's reported 54.8 AUPRC. If we lose there but win in low-data autoregressive settings, that delineates where pretraining helps.

Proposed Experiments

For forecasting we use GiftEval with observations randomly dropped at 0%, 30%, 60% and 90%, following the semi-synthetic protocol of the critical-care study's MIT-BIH experiment. Metrics are CRPS at fixed training-step checkpoints and the effective data multiplier, computed as in Tai et al.

For control we use the CTDT simulators: DIVAT, HIV dynamics and synthetic survival. We also use D4RL MuJoCo locomotion with randomly varied action-repeat, so that the decision interval itself varies. We report normalized return there and median survival on the medical simulators, at 1%, 10% and 100% data.

Three results decide the question. The first is the zero-training head probe. The second is the pretrained-by-interface interaction: the pretraining benefit should widen with irregularity under time-as-position but shrink under integer positions. The third is the head-to-head against the interval-token ablation at low data. If the interaction is absent, the proposal's central hypothesis is false. That would itself explain the critical-care negative result as a failure of the prior rather than of the interface.