TimesJev

English | 中文

TimesJev lets a System 1 model, Decider, answer time series questions in a single forward pass. A small encoder passes a compact representation of each series to the frozen Decider.

Code: https://github.com/coenliu/TimesJev

Highlights

  • Decider unchanged: Decider is used as released; only a small encoder is trained.
  • Small: each encoder has 0.5–0.7M parameters (2–3 MB).
  • Readable input: each series is described by 32 named features, chosen for each dataset.
  • One step: the answer and the probability of every option come from a single forward pass.

Model Overview

  • Type: an encoder that feeds time series features to a frozen Decider
  • Backbones: Mapika/decider-2b and Mapika/decider-4b, downloaded automatically, not stored here
  • Encoder size: 0.54M parameters for Decider-2B, 0.67M for Decider-4B
  • Input: a choice question whose text contains the series, e.g. [4.0, 6.0, 1.0]
  • Output: the chosen option and the probability of every option
  • Training data: TSQA

The encoders are in decider-2b/<dataset>/ and decider-4b/<dataset>/:

<dataset> Questions Answer
env, aiops, health, web anomaly detection: Environment, AIOps, Healthcare, Web normal or anomaly
cls human activity recognition from X, Y, Z acceleration one of 6 activities
mcq multiple-choice questions one of the options
tf true/false questions true or false

Quickstart

Download this repository and install the dependencies (install the PyTorch build that matches your CUDA version first):

pip install huggingface_hub
hf download Coenliu62/TimesJev --local-dir TimesJev && cd TimesJev
pip install -r requirements.txt

Answer one question

An anomaly detection question from the TSQA Web test set (its TSQA answer is B):

from timesjev_decider import TimesJevDecider

model = TimesJevDecider.from_pretrained("decider-2b/web")
out = model.predict(
    context="This dataset includes data from Yahoo's servers and various service metrics, allowing us to assess the "
            "operational status of the related equipment based on the information provided. The input Time Serie is "
            "[4.0, 6.0, 1.0, 8.0, 1.0, 7.0, 8.0, 3.0].",
    question="Are there anomalies in this time series?",
    options={"A": "Normal: the series contains only normal points", "B": "Anomaly: the series contains anomaly points"},
)
print(out)   # {"answer": <letter>, "probs": {"A": ..., "B": ...}}

Answer a file of questions

python timesjev_decider.py --encoder decider-2b/mcq --input examples/questions.jsonl

Each line of the file is one question: {"id": ..., "context": ..., "question": ..., "options": {"A": ..., ...}}. The script prints the chosen option and the probability of every option for each question.

How It Works

  1. Compute 32 features of the series, for example its mean, trend slope and autocorrelation.
  2. Write the features into the prompt as text, each value followed by a special token.
  3. The encoder turns each value into a vector that takes the place of that token. Decider then reads the prompt and picks an option.

Tips

  1. Use the encoder of the dataset that your question is closest to, and write the question in the TSQA format: the series inside the question text and lettered options.
  2. The features are computed from the first series in the question text. Decider sees the features, not the raw values.
  3. A GPU is used when available.

Training

Each encoder was trained on training questions of one TSQA dataset for 3 epochs (Decider-4B: 6 epochs for env, aiops, web, cls and mcq) with learning rate 1e-3, while Decider stayed frozen. The full setup, including how the features were chosen, is in the GitHub repository.

Limitations

  • Choice questions only; forecasting and free-text answers are not supported.
  • Each encoder was trained on one TSQA dataset; questions in other formats or domains may get less reliable answers.
  • A series given in the options, rather than in the question text, is read as plain text.

License

Apache-2.0, the same as TSQA and Decider.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Coenliu62/TimesJev

Finetuned
(9)
this model

Dataset used to train Coenliu62/TimesJev