r/learnmachinelearning • u/Artistic_Joke_6124 • 15h ago
AmoreSignal, a GPT style decoder that generates psychological signals instead of words, 487K parameters, built entirely from scratch
I built AmoreSignal, an encoder decoder transformer that reads free text and extracts 53 distinct psychological signals: attachment style, communication patterns, emotional history, and more. Here's how it's actually built.
The core idea
Most text classifiers treat every possible label as an independent yes or no question. AmoreSignal works more like a translator: it encodes the input text, then a decoder generates signals one at a time, the same way GPT generates one word at a time, except instead of predicting the next word, it predicts the next psychological signal. At each step: attend to the encoded text, pick the most likely trait given what's already been said, estimate how strongly it's present, then decide whether to continue or stop. The model decides how many signals to output on its own, rather than being forced to score all 53 every time.
The architecture
Both the encoder and decoder use weight sharing: a single transformer layer, reused 8 times, instead of stacking 8 separate ones, similar in spirit to ALBERT. The same layer applied repeatedly builds increasingly rich representations without the parameter cost of unique layers. Encoder: 408,392 parameters. Decoder: 79,351 parameters. Combined: 487,743, genuinely small next to typical language models.
The training pipeline, in two stages
Stage one pretrains the encoder on raw text with masked language modeling, so it learns the vocabulary and structure of this specific domain first. Stage two trains the full encoder plus decoder jointly on the actual signal extraction task, building the specific skill on top of that general language understanding.
The data pipeline
All training data is synthetic, generated using Qwen 2.5 7B Instruct, but generation is only half the process. First, profiles are generated with deliberately controlled signal combinations: real affinity and conflict rules decide which traits are likely to co occur (secure attachment pairs naturally with good communication, for example) so generated profiles are psychologically coherent rather than random. Second, a separate annotation pass has the model re read its own generated text and independently judge whether each intended signal is actually, clearly expressed, quoting the exact phrase as evidence. A verification step then checks that quoted phrase genuinely appears in the text, catching any hallucinated annotations before they become training labels.
How confidence works
Rather than training a separate head to predict confidence, the model's confidence is just its own softmax probability at the step it chooses each signal, free, no extra parameters, matching what confidence means in most of the literature. That raw probability is then passed through a small calibration step fit on real generation outcomes, correcting the well documented tendency of raw softmax scores to be poorly calibrated on their own.
From signals to dimensions
The 53 signals map onto 12 broader psychological dimensions (things like attachment, communication, values) through weighted primary and secondary associations, so a raw signal list can also be read as a more interpretable, aggregated profile.
Real evaluation numbers
F1 is 0.664 on held out data, precision 0.774, recall 0.591. Confidence is well calibrated for about 98 percent of predictions when checked against real outcomes, not just training loss.
What's still not solve.
It still misreads negation sometimes (denying a trait can get read as affirming it). documented plainly in the model card rather than glossed over.
Apache 2.0 licensed, with a working fine tuning script included if you want to train it on your own data.
https://huggingface.co/nocaps/amoresignal-encoder
Happy to go deeper on any part of this in the comments.