Jev vs. fine-tuned Laya
How much can a small amount of good training data improve a local AI model?
We compare Jev with Laya before and after fine-tuning, using six public workflow datasets, a separate curated pilot, and six moderation datasets. OpenAI and Mistral’s published safety-model scores provide additional context.
Fine-tuning brought Laya close to Jev on customer-support routing. With 1,001 labelled examples, Laya improved from 51.3% to 79.4% accuracy. Jev scored 80.0% on the same test. That small gap is not enough to call a winner.
We then tried five more public tasks. Fine-tuning improved Laya on all five. It scored higher than Jev on prompt-injection detection, SMS spam, emotion and product-review feedback; Jev stayed ahead on assistant request routing. Each task used its own fine-tuned model. See the five-task comparison.
Customer support: picking the right category
Imagine a banking assistant deciding where to send a customer's message. Is it about a lost card, a cash withdrawal, or a bank transfer? The model must choose the right category from 77 possibilities.
We used Banking77, a public dataset with human-labelled customer questions. Laya trained on just 13 examples per category: 1,001 in total. We then tested both models on all 3,080 questions in the dataset's separate test set.
| Model | Correct answers | Typical response time |
|---|---|---|
| Laya · before fine-tuning | 51.3% | 69 ms |
| Laya · after fine-tuning | 79.4% | 70 ms |
| Jev | 80.0% | 187 ms |
Laya gained 28.2 percentage points from fine-tuning. Both Laya versions had enough room to read the full list of categories, so the comparison measures the benefit of training under the same settings.
The fine-tuned Laya model answered in about 70 milliseconds on a local Apple M4 Max. Jev took about 187 milliseconds through its hosted API. Those timings include different local and network overheads, so they describe this setup rather than a universal speed advantage.
Laya's default settings scored 40.0%. Increasing the space available for the category list raised that to 51.3% before training. We use that stronger starting point throughout the main comparison.
How confident can we be in the result?
The improvement over base Laya is clear in this test: our estimated range is about 26 to 30 percentage points. The gap between fine-tuned Laya and Jev is much smaller. The data are consistent with Laya being about two points behind or one point ahead. More tests would be needed to establish a reliable difference.
Did learning banking make Laya worse at other tasks?
We also checked 100 news headlines and 100 examples of emotional language. Neither set was used for this fine-tune. News accuracy fell by one answer, while emotion accuracy rose by two. These small checks show little change, but cannot establish how the model will perform on every other task.
| Model | News: correct out of 100 | Emotion: correct out of 100 |
|---|---|---|
| Laya · after fine-tuning | 96/100 | 42/100 |
| Laya · before fine-tuning | 97/100 | 40/100 |
| Laya · default settings | 97/100 | 40/100 |
A second test: everyday AI workflow decisions
We also fine-tuned Laya on curated workflow datasets covering request routing, tool selection and safety checks. This was a separate model and experiment from the public banking test.
On a fixed set of 145 decision questions, accuracy rose from 71.7% before training to 82.8% with the smaller training set, then 91.7% with the larger set. Jev previously scored 97.2% on those questions.
| Laya training | Accuracy | Correct answers | Cases with every answer correct |
|---|---|---|---|
| Before fine-tuning | 71.7% | 104/145 | 63/100 |
| Fine-tuned on 1,007 requests | 82.8% | 120/145 | 76/100 |
| Fine-tuned on 2,646 requests | 91.7% | 133/145 | 88/100 |
This is encouraging evidence that useful examples can improve Laya across several workflow decisions. The workflow test had already informed earlier question wording, however, so these results are exploratory. The separate public banking experiment provides the cleaner comparison.
About the workflow data and its limits
The training pool combines existing workflow datasets with additional generated examples. A local Qwen model supplied the training labels. The public Banking77 experiment uses the dataset's original human labels. These are different sources of supervision, and neither Laya model was trained on Jev's answers.
There were 2,646 unique requests in the larger workflow pool. Thirteen unusable answer sets were skipped. The older training setup separated individual questions for development checks; questions from the same request could appear in both training and development. Its development score therefore should not be treated as an independent test.
Tool selection and request routing improved, but fine-tuning did not fix the model's tendency to lose information at the end of long inputs. Safety results were mixed: moderation improved, while the injection check remained one answer below the original model.
The private workflow dataset is not included in the public reproducibility package. Its figures remain a historical pilot, not a reproducible public benchmark.
Does the improvement hold across five more tasks?
We extended the comparison to five public datasets: malicious prompt detection, SMS spam, emotional tone, product-review feedback, and assistant request routing. Each task gets its own Laya fine-tune, starting from the same base model. We use up to 1,000 training examples per task and keep test examples separate. Jev uses its hosted model without additional training or examples in the prompt.
Fine-tuning improved Laya’s score on 5 of the five tasks in this run. The individual results below show where it helped and where it did not. The 99% uncertainty ranges remain above zero for 5 of those improvements.
The main score below is macro-F1: it gives each answer category equal weight and accounts for both missed matches and wrong matches. Higher is better. This matters for tasks such as spam filtering, where simply choosing the most common answer can look deceptively accurate.
| Task | Test examples | Laya before | Laya fine-tuned | Jev |
|---|---|---|---|---|
| Prompt-injection detection | 116 | 69.8% | 94.8% | 78.7% |
| SMS spam filtering | 1000 | 76.0% | 98.1% | 90.8% |
| Emotion classification | 1000 | 47.1% | 65.9% | 49.7% |
| “What if” product feedback | 670 | 57.8% | 90.0% | 86.5% |
| Assistant request routing | 1000 | 45.7% | 75.0% | 79.9% |
Training uses 1,000 examples per task, except injection detection with 446. Test sets are fixed samples of 1,000 where larger; injection uses all 116 official test examples and product feedback all 670. SMS uses a custom split because its source has no official test set. These are new, directly paired runs; scores from the earlier benchmark references are separate.
Safety check: catching malicious prompts without blocking ordinary ones
The prompt-injection task asks whether supplied text tries to override an assistant’s instructions or redirect its job. We count prompts labelled as attacks that were caught or missed, and benign prompts incorrectly flagged.
| Model | Attacks caught | Attacks missed | False alarms on benign prompts |
|---|---|---|---|
| Laya before | 31/60 | 29 | 5/56 |
| Laya fine-tuned | 57/60 | 3 | 3/56 |
| Jev | 36/60 | 24 | 0/56 |
This small dataset tests classification of labelled prompt text. It does not establish that an LLM protected by the classifier is safe from successful attacks. Some examples lack the full system and task context needed to settle borderline cases.
Accuracy, response times, uncertainty and dataset notes
| Task | Fine-tuning gain in macro-F1 | 99% uncertainty range, points |
|---|---|---|
| Prompt-injection detection | +25.0 points | +14.0 to +36.5 |
| SMS spam filtering | +22.1 points | +17.8 to +26.5 |
| Emotion classification | +18.8 points | +14.2 to +23.7 |
| “What if” product feedback | +32.2 points | +25.0 to +39.1 |
| Assistant request routing | +29.3 points | +24.8 to +33.7 |
| Task / model | Accuracy | Always choose most common | Typical response time | Failed requests |
|---|---|---|---|---|
| Prompt-injection detection · Laya before | 70.7% | 51.7% | 19 ms | 0 |
| Prompt-injection detection · Laya fine-tuned | 94.8% | 51.7% | 22 ms | 0 |
| Prompt-injection detection · Jev | 79.3% | 51.7% | 203 ms | 0 |
| SMS spam filtering · Laya before | 85.2% | 87.7% | 18 ms | 0 |
| SMS spam filtering · Laya fine-tuned | 99.2% | 87.7% | 19 ms | 0 |
| SMS spam filtering · Jev | 95.5% | 87.7% | 190 ms | 0 |
| Emotion classification · Laya before | 56.8% | 34.7% | 16 ms | 0 |
| Emotion classification · Laya fine-tuned | 73.1% | 34.7% | 16 ms | 0 |
| Emotion classification · Jev | 58.6% | 34.7% | 186 ms | 0 |
| “What if” product feedback · Laya before | 81.5% | 80.4% | 18 ms | 0 |
| “What if” product feedback · Laya fine-tuned | 93.3% | 80.4% | 20 ms | 0 |
| “What if” product feedback · Jev | 91.6% | 80.4% | 195 ms | 0 |
| Assistant request routing · Laya before | 56.1% | 7.0% | 57 ms | 0 |
| Assistant request routing · Laya fine-tuned | 81.5% | 7.0% | 57 ms | 0 |
| Assistant request routing · Jev | 82.8% | 7.0% | 192 ms | 0 |
We use a separate test for each task rather than blending everything into one accuracy score. Paired uncertainty intervals compare the models on the same examples. The five main fine-tune-versus-base comparisons use 99% intervals to allow for testing several tasks; other comparisons use descriptive 95% intervals. This is one training seed per task, so further runs could measure how sensitive the gains are to training randomness.
Duplicate examples, conflicting training labels, official test and validation texts, and previously benchmarked examples are excluded from training. Dataset familiarity during the original models’ pretraining remains unknown. Labels come from each source dataset; they are not all manually assigned.
A later check also looked for nearly repeated wording and templates that differ only in numbers. It flagged four SMS test examples, one product-review example and one assistant-routing example; none in injection or emotion. This is an additional sensitivity check, not a change to the original test. The audit records the examples and scores after excluding them. It cannot detect every semantic overlap.
Emotion permits research and educational use. The original product-feedback dataset specifies non-commercial use. Those datasets and the resulting weights are not included in a public redistribution package by this experiment. Other dataset terms and exact source versions are recorded in the protocol.
Read the five-dataset protocol · Inspect every score and uncertainty interval
Chat moderation: stronger detection, more false alarms
A moderation model must catch harmful material while letting ordinary conversation through. We trained two more Laya models on 1,000 and 5,000 labelled decisions from Aegis, then tested them on six safety datasets. These models use the datasets’ existing labels; no Jev answers were used for training.
The score here is harmful-content F1, which balances catching harmful examples against incorrectly flagging harmless ones. It is a different measure from the macro-F1 used in the five-task comparison above.
| Test | Decisions | Laya before | Laya · 1k | Laya · 5k | Jev · measured here |
|---|---|---|---|---|---|
| Aegis · prompts | 1,928 | 60.6% | 81.5% | 83.7% | 82.6% |
| Aegis · responses | 813 | 37.4% | 69.5% | 77.0% | 79.6% |
| ToxicChat · prompts | 2,853 | 36.4% | 50.5% | 53.3% | 72.6% |
| WildGuard · prompts | 1,699 | 48.7% | 59.4% | 65.7% | 87.5% |
| WildGuard · responses | 1,709 | 20.8% | 53.3% | 51.6% | 79.8% |
| BeaverTails · responses | 3,021 | 6.0% | 34.1% | 59.4% | 77.5% |
| OpenAI Moderation · known binary labels | 859 | 59.1% | 81.8% | 81.4% | 87.7% |
| OpenAI Moderation · known category decisions | 9,298 | 23.1% | 24.6% | 25.8% | 63.8% |
OpenAI Moderation above uses 859 examples with known binary labels, not the full 1,680-example published benchmark. Missing category labels are unknown, not safe. The separate category evaluation covers 9,298 known category decisions. Aegis response and WildGuard tasks also omit missing or unusable labels; exact counts and rules are in the full moderation report.
Jev model: typesafe/jev-1.13-20260917. The run covers 22,630 decisions with 1 request failure. Failed requests remain in the evidence and error counts. All 67,890 Laya moderation decisions completed without request failures.
The moderation comparison is less favourable to Laya than the workflow results. On the same test cases, Jev scores 72.6% on ToxicChat and 79.8% on WildGuard responses, compared with 53.3% and 51.6% for the larger Laya fine-tune. Aegis prompt scores are closer: 82.6% for Jev and 83.7% for fine-tuned Laya. Learning the training domain does not guarantee equally strong results elsewhere.
Jev’s moderation column comes from fresh hosted-model requests on the same frozen test cases and question wording as Laya. The saved model identities, errors and paired uncertainty estimates are available in the Jev moderation analysis. Jev is evaluated as a classifier, not used as a source of training labels. These are secondary comparisons added after reviewing the Laya results; the descriptive 95% paired intervals are not corrected for testing multiple tasks. The Jev requests use four concurrent hosted calls; Laya runs locally one request at a time. Latency is therefore not a controlled speed comparison. Jev receives the full source text, with provider-side truncation unknown; Laya has a 2,048-token limit.
What happens to harmless requests?
XSTest includes 250 harmless prompts that can look risky out of context. Fine-tuning raised Laya’s false-alarm rate from 24.8% to 65.2% with 1,000 training decisions and 47.2% with 5,000. Better detection alone does not establish a dependable general-purpose safety filter.
Jev flags 19 of the 250 harmless prompts (7.6%) and catches 188 of the 200 harmful prompts (94.0%). Those two measures belong together: blocking less is only helpful if harmful requests are still caught.
| Model | Harmless prompts flagged | False-alarm rate ↓ | Harmful prompts caught | Harmful recall ↑ |
|---|---|---|---|---|
| Laya before | 62/250 | 24.8% | 123/200 | 61.5% |
| Laya · 1k | 163/250 | 65.2% | 168/200 | 84.0% |
| Laya · 5k | 118/250 | 47.2% | 183/200 | 91.5% |
| Jev | 19/250 | 7.6% | 188/200 | 94.0% |
How do OpenAI and Mistral compare?
The figures below are advertised results from the model publishers. We did not rerun these models. They provide context, but differences in policies, retained examples and scoring mean they are not a controlled leaderboard against our Laya and Jev measurements.
| Published benchmark | Mistral Shieldstral 3B | OpenAI safeguard 20B · evaluated by Mistral |
|---|---|---|
| WildGuardTest · prompts | 88.1% | 87.3% |
| ToxicChat · prompts | 84.1% | 79.8% |
| Aegis v2 · prompts | 86.2% | 84.4% |
| OpenAI Moderation · prompts | 81.4% | 84.0% |
| WildGuardTest · responses | 80.4% | 80.7% |
| BeaverTails · responses | 85.0% | 83.8% |
| Aegis v2 · responses | 87.2% | 75.2% |
Source: Mistral’s pinned model card. F1 as reported; Shieldstral threshold 0.5 and safeguard at high reasoning effort. The OpenAI Moderation row uses a different selection from our known-label subset.
| OpenAI’s own published evaluation | OpenAI Moderation | ToxicChat |
|---|---|---|
| gpt-oss-safeguard-120b | 82.9% | 79.3% |
| gpt-oss-safeguard-20b | 82.9% | 79.9% |
Source: OpenAI technical report, Table 2. These are OpenAI’s experiments, separate from Mistral’s safeguard column. Exact policy and missing-label treatment are not established as matching this study.
The Aegis budgets count labelled decisions, not distinct conversations; the 1,000-decision set is nested inside the 5,000-decision set. We used one training seed and the final checkpoint after three passes through each set. Training excludes exact normalized overlaps with the frozen tests. Eight long WildGuard responses are truncated; the detailed report includes a sensitivity check. These checks do not establish whether a base model saw a dataset during pretraining.
Aegis fine-tuning improves detection within the training domain and on several other datasets. It also exposes a practical limit: broader blocking can help a detection score while making a chat product frustrating to use. The next useful experiment would measure whether targeted harmless examples and a development-set threshold can reduce false alarms without losing the gains.
Read the full moderation study · Repeat the moderation experiment · Inspect all Laya scores and uncertainty ranges
What this means in practice
For a well-defined task with a fixed set of possible answers, a modest amount of relevant training data can make a substantial difference. The banking experiment and all five additional tasks support that conclusion. Fine-tuned Laya also scored above Jev on four of the five additional tasks, while Jev retained the lead on assistant routing.
The choice still depends on the workload. Fine-tuning takes labelled examples, training time and a way to run the resulting model. Jev provides a hosted option. Accuracy, response time, running costs and the consequences of a wrong answer all matter.
These results come from one training run per experiment. They do not establish that either model will perform equally well on new topics, longer conversations or production traffic. We kept the public test questions out of fine-tuning, although we cannot know whether either original model encountered them during its earlier training.
How this fits with existing benchmarks
The awesome-jev collection points to independent tests of routing, spam detection, information extraction and other AI workflows. Earlier local runs against several of these benchmarks helped identify where Laya needed improvement.
Earlier benchmark results and source links
The Jev figures below come from the benchmark authors' published results. The Laya figures are our earlier local runs of the base model. They use different tasks and test sizes from the new fine-tuning study, so they should be read separately.
| Protocol / task | Items | Jev, published | Laya, local |
|---|---|---|---|
| Classification pilot · AG News, 4 labels | 100 | 91.0% | 97.0% |
| Same pilot · emotion, 6 labels | 100 | 48.0% | 40.0% |
| Same pilot · banking, 72 labels | 100 | 87.0% | 2.0% stock / 16.0% wider |
| Email spam · original seed-42 binary protocol | 500 | 98.0% | 97.2% |
| Decision Model Benchmark · SMS spam | 300 | 93.0% | 86.7% |
| Same benchmark · 77-way banking intent | 300 | 76.3% | 36.0% |
| Agent failure attribution · who / when / what | 300 | 90.7 / 80.0 / 34.3% | 64.3 / 29.3 / 10.3% |
| Smoking-history extraction · all 10 fields correct | 1,000 | 92.4% | 25.4% |
The classification test used the same saved list of examples across models. The earlier run records report matching examples for email, agent failure and smoking-history extraction. Decision Model Benchmark used three repeats for the author's Jev results and one local Laya repeat. Some source projects have since expanded their tests. For SMS spam, always choosing the most common answer would score 87.7%, above this Laya result.
ASSAY-001 studies routing accuracy and confidence using saved inputs and outputs. Jev Rerank Bench tests which retrieved documents are most relevant. Jev Security Bench examines prompt injection and vulnerable code. These are useful references; we have not run new fine-tuned Laya comparisons on them here.
Methods and supporting data
The sections below contain the details needed to check the results or repeat the public experiment.
Training setup and complete scores
We selected 1,001 training questions and 770 separate development questions from Banking77's original training set. We removed overlap with the official test set, duplicate training questions and conflicting labels. All 3,080 official test questions remain in the final evaluation.
The public fine-tune started from base Laya and made three passes through the training set. We used the final saved model, without choosing a version based on test results. Both the base and fine-tuned comparisons allowed 1,024 tokens in total and 768 for the answer options. A token is a small unit of text used by the model.
| Model | Accuracy | Macro-F1 | Correct | Median ms | 95th percentile ms | Failed requests |
|---|---|---|---|---|---|---|
| Laya · default settings | 40.0% | 35.3% | 1,232/3,080 | 40 | 43 | 0 |
| Laya · before fine-tuning | 51.3% | 49.9% | 1,579/3,080 | 69 | 73 | 0 |
| Laya · after fine-tuning | 79.4% | 79.5% | 2,447/3,080 | 70 | 74 | 0 |
| Jev | 80.0% | 79.3% | 2,463/3,080 | 187 | 309 | 0 |
Macro-F1 gives each category equal weight when combining precision and recall. The 95th-percentile time is the response time below which 95% of requests finished. All requests ran one at a time.
Fine-tune minus base: +28.2 percentage points; 95% grouped paired bootstrap interval +26.4 to +30.0 points. 5,000 resamples over 3,076 normalized-text groups, seed 7. This measures test-sample uncertainty conditional on the two checkpoints, not training-seed variability. Secondary comparison, fine-tuned Laya minus Jev: -0.5 points (95% interval -2.0 to +1.0). That interval includes zero; this run establishes neither superiority nor equivalence between them.
The uncertainty calculation resamples the test examples 5,000 times, keeping duplicate texts together. It estimates variation from the test sample, not variation across repeated training runs. Dataset files, model versions and settings are recorded in the linked evidence.
Confidence scores and cost
A model can be confidently wrong. We therefore checked whether its predicted probabilities matched how often its answers were correct. Fine-tuning improved Laya's confidence estimates substantially on the banking test.
| Model | Brier ↓ | NLL ↓ | ECE ↓ | Answers scored | API cost for this test |
|---|---|---|---|---|---|
| Jev | 0.3078 | 2.0142 | 0.0856 | 3,080 | $0.1335 |
| Laya · default settings | 1.1789 | 15.7408 | 0.5859 | 3,080 | No API fee |
| Laya · before fine-tuning | 0.9518 | 12.2618 | 0.4719 | 3,080 | No API fee |
| Laya · after fine-tuning | 0.2969 | 0.7475 | 0.0143 | 3,080 | No API fee |
Lower is better for all three measures. Brier measures probability errors across the categories. NLL penalizes assigning very little probability to the right answer. ECE compares stated probability with observed accuracy. We use the probability of the chosen answer, not the model's separate confidence field. Small rounding differences are normalized; unusable probability maps are excluded from these measures. Failed requests still count against accuracy.
Local Laya has no per-request API fee, but hardware, electricity and training still cost money. Jev's reported API charge for these 3,080 questions was about $0.13.
Adjusting confidence using a separate development set
We also tested a simple confidence adjustment, known as temperature scaling. We chose the adjustment using only the 770 development questions, then applied it to the test results. It changes the probabilities, not the answers.
| Model | Adjustment | NLL before → after | ECE before → after |
|---|---|---|---|
| Laya · after fine-tuning | 0.938 | 0.747 → 0.744 | 0.014 → 0.021 |
| Laya · before fine-tuning | 6.151 | 12.262 → 2.666 | 0.472 → 0.053 |
The adjustment helped base Laya substantially. For fine-tuned Laya, NLL improved slightly while ECE became slightly worse. These calculations use rounded saved probabilities and approximate the adjustment available from full model scores. They do not change the served models.
Download the evidence and repeat the experiment
- Jev: saved predictions and metrics
- Laya · default settings: saved predictions and metrics
- Laya · before fine-tuning: saved predictions and metrics
- Laya · after fine-tuning: saved predictions and metrics
- Full method and reproduction commands
- Dataset sources and exact split records
- Scores, uncertainty ranges and confidence analysis
- Hardware and software versions
- Verification of the Jev test requests
Banking77: Casanueva et al., Efficient Intent Detection with Dual Sentence Encoders (2020), PolyAI, CC BY 4.0.