Machine learningNovember 2025

Machine Learning & Model Research

X-Trend reproduction

Two iterations of a few-shot forecasting reproduction, including a tensor-level correction to what attention values remember.

PyTorchCross-attentionLSTMExpanding windowsGaussian processesSparse jump models
Why it sits here. Placed by the scope of implementation, the available contribution evidence, and the distinct technical capability it demonstrates.
03 / Somewhere between data and understanding.STUDY IN SPACE

THE QUESTION

If a key retrieves a similar market state, does the value include its observed outcome?

Reproduce and investigate an existing financial time-series approach, connecting paper equations to the actual tensors.

WHAT SHOULD ATTENTION REMEMBER?
market conditionsK
conditions + outcomesV
Similarity finds the context.
The value carries what happened next.
Concept diagram · not performance data

01 / IMPLEMENTATION & CONTRIBUTION

What the work involves

Donald’s agent-assisted adaptation of X-Trend implements Q/K/V projections and corrects attention values to include observed context returns. Two iterations form one evolving reproduction of the upstream research.

Technical depth

A tensor with the right shape can encode the wrong meaning. Paper alignment requires checking both data availability and the information flowing through attention.

Data and assumptions

Historical financial time series and context windows. No proprietary source dataset is redistributed on this site.

Context outcomes must be observed by prediction time. Matching an architecture does not reproduce its reported financial results.

The project family

XTRENDxtrend_revised

02 / THE EXPERIMENTAL RECORD

What the experiment taught

The initial key and value encoders both used conditions alone, omitting returns from the value representation.

What changed

The corrected value projection concatenates context features and observed returns. Normalization and training protocols also evolved.

03 / RESULTS

What came out of it

The revised PyTorch construction lets retrieved context carry both market conditions and their observed outcomes. Experiment notes also record numerical instability in change-point fitting and later segmentation changes; original-paper performance remains unverified.

The lesson in the work

Trace the meaning of every tensor, not only its dimensions.

04 / SUPPORTING EVIDENCE

Follow the source

Implementation notes, project records, and supporting artifacts.

Source context & project scope

Do not repeat the early README claim of superior returns or commit subjects naming target Sharpe as achieved performance. Architecture reproduction, economic reproduction and live trading remain distinct.

Reproduction and adaptation of upstream X-Trend research. No claim to authorship of the original paper.

Keys should match on MARKET CONDITIONS. Values should contain OUTCOMES.

REPORT · 2025-11

torch.cat([context_states, context_returns_expanded], dim=-1)

SOURCE · 2026-09-17

Values initially omitted observed outcomes; debugging note explains the correction.

SOURCE · 2026-09-17

Outcome concatenation is present in current value projection.

SOURCE · 2026-09-17

Historical normalization failure and threshold limitations.

SOURCE · 2026-09-17

Earlier A-share few-shot implementation, dashboard and market-friction scope.

SOURCE · 2026-09-17

4ff852e records causal normalization; 5f5ed8a records expanding-window training.

SOURCE · 2026-09-17
CONTINUE IN MACHINE LEARNING & MODEL RESEARCH

VAE, DDPM & guided diffusion