Repository navigation
Description
Raising here first so we can agree the diagnosis, then take it to the granitelib authors. Both findings
are in the published adapter artefacts rather than in Mellea.
What happens today
You write a requirement, run it against a Granite 4.1 model, and ask Mellea to check it. Two things are
wrong, and they are independent of each other.
The adapter never switches on. Mellea downloads the requirement-check aLoRA, loads it, and reports
it as active. Its declared activation point cannot appear in the prompt, so it contributes nothing.
Nothing in the output or the logs tells you.
Its verdicts are worse than the LoRA's. On ten requirements with obvious answers, the aLoRA got 8
right and the LoRA got all 10. Both aLoRA misses went the same way: it scored above 0.99 for
requirements the response plainly fails. In Mellea that means Requirement.validate() returns True,
so a sampling strategy keeps a candidate it should have rejected or repaired.
Fixing the first problem does not fix the second. I checked, and the numbers barely move.
Why that is a problem
Requirement checking is the most used adapter capability in Mellea. It sits behind
Requirement.validate(), which drives rejection sampling and repair loops. A checker that fails open
is the expensive kind of wrong: the caller sees a pass, the loop stops trying, and nothing downstream
records that the verdict came from a different mechanism than it used to.
Mellea currently selects the LoRA on the automatic path, so users are not exposed today. #1654 changes
resolution to prefer whichever rung is published, and aLoRA is published for Granite 4.1, so this
becomes live the moment the activation problem is fixed.
How it should behave
The aLoRA should activate, as its own configuration intends. Once it does, its verdicts on
straightforward requirements should be at least as good as the LoRA's, since we would rather prefer
aLoRA everywhere: it shares the base model's KV cache and swaps dynamically, which makes it
considerably cheaper to serve.
What we are asking for
- A decision on which side of the activation mismatch should change, and a fix in the published
artefacts. - Any evaluation numbers you already have for
requirement-checkaLoRA against LoRA. If parity was
measured at training time, our ten probes turn into a narrow question about where our results differ
from yours, which is much less work than building a new evaluation. - If no such numbers exist, agreement on what readiness looks like. Our suggestion: a labelled
requirement set spanning content, factual, length, format, style and language constraints, run on both
rungs over identical items and every published model slot, reporting accuracy and false-pass rate
separately, compared with a paired test over discordant pairs rather than two accuracy figures put
side by side.
Environment for everything below: ibm-granite/granite-4.1-3b, granitelib-core-r1.0 at the revision
Mellea's catalogue pins, transformers 5.10.2, peft 0.19.1, temperature 0.0. Values reproduced
identically across separate processes.
Detail: problem 1, the activation sequence cannot occur in the prompt
adapter_config.json declares:
alora_invocation_tokens: [27, 71226, 29] # decodes to: <requirements>
The same slot's io.yaml instruction starts <requirements>:. The Granite tokeniser merges > with the
following : into one token, so the declared sequence cannot appear:
'<requirements>: X' -> [27, 71226, 27916, 1630] ['<', 'requirements', '>:', ' X'] no match
'<requirements> X' -> [27, 71226, 29, 1630] ['<', 'requirements', '>', ' X'] matches
PEFT looks for the sequence in input_ids and, when it is absent, sets the activation offset to None
with no warning (peft/tuners/lora/variants.py, calculate_alora_offsets,
else: # Invocation sequence not found in input). The adapter stays listed as active.
Instrumenting the real call: the assembled prompt is 96 tokens, the declared sequence is absent, and
[27, 71226, 27916, 578] = '<requirements>: The' sits where it would have been. The loaded PEFT config
does carry alora_invocation_tokens, so the config is read correctly and the prompt simply cannot satisfy
it. Patching the instruction prefix to <requirements> makes the sequence appear at token 28, which
confirms the cause.
All three published slots declare the same sequence against the same instruction text, so all three are
affected: requirement-check/granite-4.1-3b/alora, .../granite-4.1-8b/alora,
.../granite-4.1-30b/alora.
Other aLoRA capabilities checked on granite-4.1-3b are fine. uncertainty declares <certainty>,
which its instruction contains. answerability, query_rewrite and query_clarification declare
<|start_of_role|>assistant<|end_of_role|>, which the chat template supplies.
Either side can move. The instruction prefix could become <requirements> , which tokenises to the
declared sequence. Or alora_invocation_tokens could be changed to what the current instruction
produces, including the merged >: token. Which one is right depends on what the adapter was trained
against, which is why this needs you rather than a patch on our side.
Detail: problem 2, the verdict comparison
A smoke test rather than an evaluation. Ten requirements with unambiguous answers against one fixed
response, threshold 0.5, one adapter loaded per process.
Context: user asks "Write one sentence about Cardiff."; assistant answers "Cardiff is the capital city
of Wales."
| Requirement | Truth | aLoRA | LoRA |
|---|---|---|---|
| The response mentions Wales. | pass | 1.0000 | 0.9241 |
| The response is written in French. | fail | 0.9975 | 0.0293 |
| The response contains at least 50 words. | fail | 0.0032 | 0.0097 |
| The response is a single sentence. | pass | 1.0000 | 0.9047 |
| The response names a city. | pass | 1.0000 | 0.9241 |
| The response includes a numeric statistic. | fail | 0.0000 | 0.0059 |
| The response mentions Scotland. | fail | 0.0000 | 0.0059 |
| The response is fewer than 20 words. | pass | 1.0000 | 0.9325 |
| The response uses bullet points. | fail | 0.9997 | 0.0052 |
| The response identifies a capital city. | pass | 1.0000 | 0.9466 |
aLoRA 8/10, LoRA 10/10. The injected prompt was byte-identical in both arms, so the requirement text
reaches the adapter either way and the only difference is which weights load.
Ten probes and one context characterise neither adapter. What they do establish is that the two rungs are
not interchangeable, and that where they diverge the aLoRA fails open.
Detail: hypotheses already ruled out, and what is still open
Ruled out:
- Missing activation. Patching the prefix so activation fires at token 28 left the French requirement
at 0.9988, against 0.9975 before. - Wrong prompt shape from Mellea. The assembled prompt is the conversation, then a user turn carrying
<requirements> <requirement>plus the verification instruction, then the assistant generation prompt.
With activation working, the adapter applies to the last 68 of 96 tokens, from the marker onwards. The
base model computes the conversation prefix and the adapter covers the instruction and the generation,
which is the arrangement an aLoRA expects. - Requirement text not reaching the adapter. It is present and correctly interpolated in both arms.
Still open: two of the ten probes are requirements about the response itself ("written in French", "uses
bullet points") rather than about its content, so they may be outside the adapter's training
distribution. That does not make a fail-open verdict acceptable, and the LoRA handled both, but it does
shape what an evaluation should cover.
The harness behind the table is ten lines around Mellea's core.requirement_check with the rung forced.
Happy to share it, or to run an agreed probe set on our side.
Follow-through
- Share the evaluation result on PR feat(adapters)!: prompt fallback for adapter functions without a trained adapter #1654, in the thread on
mellea/backends/adapters/adapter.py:539, including if it shows parity on content requirements. That thread carries a request-changes verdict which currently rests on the ten-item smoke test above, so the larger result belongs there either way: it either firms the ask up or softens it.
Related
Found while reviewing #1654, which makes the aLoRA rung selectable on the local Hugging Face path for the
first time. Mellea-side detection, and the gate that keeps the LoRA selected until this is resolved, is
#1678.
Activity
planetf1 commentedon Sep 25, 2026
currently investigating
planetf1 commentedon Sep 25, 2026
working on this
planetf1 commentedon Sep 25, 2026
Update: diagnostic evaluation in progress
Running a larger paired probe set against
requirement-check(granitelib-core-r1.0)across LoRA, aLoRA, and an activation-patched aLoRA, on all three published Granite
4.1 sizes (3b/8b/30b), to move past the original 10-item smoke test.
Early signal, not yet a conclusion — still verifying before writing this up properly:
whether the verdicts are accurate — those two things don't seem to move together
so far.
model sizes rather than being uniform.
Will follow up with the full methodology, numbers, and confidence levels once
verified. Flagging now so this doesn't look stalled.
planetf1 commentedon Sep 25, 2026
Update: there is a third root cause, and it is on Mellea's side. The "aLoRA is dead on these models" conclusion in the linked discussion does not hold.
Running the diagnostic with instrumentation one level deeper than the analysis in this issue, plus a controlled re-eval, turned up two further findings:
1. The aLoRA was never activated in Mellea, in any intrinsic (Mellea-side bug).
Mellea loads intrinsic adapters via
model.load_adapter()(transformers'PeftAdapterMixin), which injects LoRA layers into the bare model. PEFT computes and injects the aLoRA rank offsets only from inside itsPeftModelwrapper'sgenerate()/forward()overrides, so on theLocalHFBackendpath the aLoRA variant layers never receive offsets and mask the adapter off for every token. Instrumented count of PEFT's aLoRA hook calls during a full requirement-check invocation: zero. Thecheck_hook_fires.pyprobe in this issue's tree confirmed: 0 hook calls, score 0.9999 (base-model answer) with the aLoRA "active".This re-interprets two findings in the issue:
2. The
uncertaintyaLoRA works as-published once #1 is fixed (no io.yaml mismatch in its file), measured on/off gap 0.67-0.87 at 3b. So the "aLoRA weights are untrained" hypothesis does not hold up either.The issue's two published-artefact findings remain valid and are independent blockers for requirement-check specifically: the io.yaml
alora_invocation_tokensvs instruction text tokenization mismatch, and the README/adapter_config inconsistency. As the issue says, the direction of that fix (colon in the instruction vs tokens in the config) is for the granitelib team to decide based on what the weights were trained against. I will file it there.PR #1685 contains:
LocalHFBackend's generate path (the actual Mellea bug), with unit tests that fail on the pre-fix code and two e2e differential tests that prove activation through the real backend on both affected capabilities;Consequently the request-changes verdict on PR #1654, which rests on the "aLoRA is broken at the weights level" reading of this analysis, should be re-evaluated against the activated results.
Diagnostic tree and full before/after numbers:
scratchpad/alora-activation-1678/eval_1679/STATUS.mdin the worktree for this issue.fix(backends): repair aLoRA instruction on the shim path and harden a…
refactor(adapters): move the aLoRA io.yaml repair helpers into their …
fix(backends): run the composed aLoRA repair before prepare() and tig…
docs(adapters): trim transient issue references from aLoRA guard docs
fix(backends): activate aLoRA adapters on the LocalHFBackend generate…
fix(adapters): raise or fall back when an aLoRA cannot activate (gene…
fix(adapters): raise or fall back when an aLoRA cannot activate (gene…
fix(adapters): raise or fall back when an aLoRA cannot activate (gene…
fix(adapters): raise or fall back when an aLoRA cannot activate (gene…
chore(adapters): bump granitelib-core pin for fixed requirement-check…