Training The First System-1 Model for physiological signals
A non-autoregressive System 1 decision model for physiological signals.
Heyy, well, if you’re alive and breathing, you may’ve heard about the new cool dude in town. Yep! Jev. Jev is a System 1 model introduced by TypeSafe AI. Its hypothesis is mainly to remove the recursive token generation of our LLMs and replace it with a decision model. You give it some data x, a couple of options, and it gives you back a decision with a probability. Since it’s trained to choose, not generate, it architecturally can’t give you back something outside your given choices, or hallucinate. It can still be wrong, though.

Anyway, it became the new shiny thing, and everyone was jumping on it and applying it to their use cases. The open-source community also extended it to other modalities, such as image, video, and audio.
Well, I’m not going to write about how Jev or System 1 models work. If you wanna read about that, just type Jev into your favorite search engine or check https://typesafe.ai/blog/introducing-system-one-models-and-jev. But we’re going to talk about how to make the first-ever System 1 model for native physiological data. Yeah, you heard me. We take native PPG, EEG, and ECG signals, a question, and choices, and we return the predicted choice and a calibrated probability in one pass.
Why?
Well, I think the main card we’re playing here is calibration and the flexibility you’ll have, as you can ask different questions with different labels as a zero-shot classifier. Let me give an example. Let’s say you’re using this model in a Responsive Neurostimulator System (RNS), which detects epilepsy and sends small electrical signals to the brain to stop a seizure before it happens. Let’s say this model says it detected epilepsy with an accuracy of 85%. How much can we trust it? If the model is overconfident, maybe it’s right 70% of the time, which would lower the actual accuracy. So, the main concept of RLCD (Reinforcement Learning for Calibrated Decision) is training a model to choose the correct label, and that’s the only way it gets a reward.
What are we making?
I’ve tried RLCD and didn’t get a better ECE or performance score than with normal cross-entropy, so our main goal here is to take a physiological signal (ECG, PPG, EEG, iEEG), the question we want to answer, and our labels. We’ll encode the question and answers using BioLord, encode the signal using SPOTR, and pass them into a single head that can contextualize the relationship between whatever signal we send and the questions and answers, and select the answer by assigning a probability to it. Note that we’re not training a decision head per task; we’re training one decision head that can take these signals and answer any form of question you might have. Like, you can give it a PPG signal and ask, “Does this signal have AF?” and also ask, “What’s the heart rate?” and “What’s this guy’s emotion?” Cool, right? A picture is worth a thousand words, so let’s draw it.


What dataset?
We augment publicly existing datasets like PulseLm, WESAD, DriverFatigue, and CHB-MIT and shape them into decision format. You can find it below :)
Our Decision Head
As I’ve said earlier, the two inputs for our decision head are the signal embedding we get from the SPOTR encoder and the separately encoded embeddings for the question and candidate answers.
Let’s first look at the question-candidate side. We first normalize them and then add role embeddings to identify which is the question and which are the candidates. I add these because our bi-encoders attend every token to every other token. Then we apply self-attention, pass them through a feed-forward layer, and forward them to our cross-attention block. For the signal tokens we get from the signal encoder, we just normalize them and pass them to our cross-attention block.
In our cross-attention, we take the question and answer vectors as the query and key, and the signal as the value. We then pass it through an FN layer, split our question from the answers using the role embeddings we added earlier, score each candidate with an MLP, and calculate our loss using cross-entropy over our softmax probabilities. I guess it’ll be easier if I put the arc here, so here it is.

Training
I got caught up in other works and I didn’t retrain it with the newer arc, but the earlier and the simplest arc used a very simple flow
- Signal + metadata → validation / raw-signal cleaning → frozen SPOTR → 512-D signal vector
- Question and candidates → frozen BioLORD-2023 → separate 768-D text vectors
- Signal and text vectors → MLP fusion head → candidate logits → softmax probabilities
The full run for this training used 1,637,289 processed, normalized PPG QA rows, each containing a 10-second signal at 125 Hz. The three-epoch run used batch 512, AdamW with learning rate 0.0003, weight decay 0.01, label smoothing 0.05 and gradient clipping at norm 1. No class weighting was used. Both encoders remained frozen. Questions and targets preserve the supplied QA content.
The selected checkpoint is update 4,797 of 9,594, chosen by NLL on 196,707 selection rows at 1,599-update intervals. Separate calibration and test roles contain 21,342 and 323,944 rows. Native train/test membership was retained; the supplied validation corpus was divided into selection and calibration roles before training. Known connected subject, recording and waveform identities remain disjoint.
Results
The early results were very promising, and which motivated me to expand to the newer arc :)


Code and Model
New Code: https://github.com/yeabwang/paya
Previous code and Model: https://huggingface.co/yeabwang/Paya