Instructions to use 1000luca/FlexDM-LoRA-v2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 1000luca/FlexDM-LoRA-v2.0 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Configuration Parsing Warning:In adapter_config.json: "peft.task_type" must be a string
FlexDM-LoRA ver 2.0 · Gemma-4-31B
A LoRA adapter for google/gemma-4-31B-it @ 842da3794eaa0b77d5f08bae87a17459d91ff475
for structured decisions: a state (a document, a conversation, a device list, ...) and one or more multiple-choice or
yes/no questions about it. The answer is a probability for every option, read from the option-label logits at
Answer: (. Nothing is generated. It is served like FlexDM, with the
same prompts and temperatures, with this adapter loaded in vLLM.
ver 2.0 is a new adapter trained on new data (below). Other versions: ver 1.0 1000luca/FlexDM-LoRA-v1.0, ver 2.1 1000luca/FlexDM-LoRA-v2.1.
| ver 1.0 | ver 2.0 | |
|---|---|---|
| Training questions | 90,007 | 115,249 |
| Steps × tokens | 934 × 64k | 1,001 × 62k |
| Served strength | 0.5 | 0.5 |
| Low-confidence re-read | no | yes (below 0.6, reversed option order) |
| Decision Index 0.3 public index | 65.47 | 66.49 |
Files
| Path | What |
|---|---|
adapter_config.json, adapter_model.safetensors |
The served adapter (load this one in vLLM). r 64, lora_alpha 64, all seven projections of the 60 text layers. |
merge_info.json |
How the served copy was made from the trained adapter (strength 0.5, the v_proj copies below). |
peft/ |
The same adapter for transformers / PEFT. |
code/jevlab/ |
The engine that ran the submission (sha256 as in the run's driver.json). |
code/requirements.txt |
The exact Python 3.12 environment (vLLM 0.30.0, torch 2.13.0+cu130, transformers 5.16.1). |
Why two copies: Gemma 4's full-attention layers have no v_proj (attention_k_eq_v: V is the k_proj output), so in
transformers the k_proj LoRA changes both K and V. vLLM gives the V slice of its fused qkv_proj its own LoRA, so the
served copy repeats the k_proj LoRA as v_proj on those 10 layers (5, 11, ..., 59). Without it, vLLM would serve V
without the trained change. peft/ is the original for transformers.
Serving (as submitted)
With the kit's own runner and code/ on PYTHONPATH (one GPU with about 75 GB free):
python -m decision_index run --engine jevlab.vllm_lora_reader:VllmLoraReader \
--option lora=/path/to/this/repo --option layout=header --option read_twice=true --option twice_max_tokens=3000 \
--option temperature_choice=10.9757 --option temperature_choice_log_slope=-1.7016 \
--option temperature_noul=10.732 --option noul_bias=0 --option reverse_below=0.6 --compact --out runs/flexdm-lora
- vLLM 0.30.0 offline
LLM, FP8 per-block quantization of the base at load (fp8_per_block), TRITON_ATTN, prefix caching,max_model_len131,072,gpu_memory_utilization0.70,enable_lora,max_lora_rank64, unmerged adapter. SetVLLM_USE_DEEP_GEMM=0and put the venv'sbin/first onPATH(FlashInfer needsninja). - Read policy: the
headerlayout (the request's question list, then the state, then the question and its options), Gemma's chat template with thinking off. Requests of at most 3,000 tokens have their user turn written twice, joined byRead the same input again before answering:. One rendering for every benchmark. - New in ver 2.0: a question whose most likely option has probability below 0.6 is read once more with its options
in reverse order, and the two distributions are averaged (
reverse_below=0.6; the option already exists in FlexDM v1.0). - Probabilities: softmax of the label log-probabilities at choice
T = 10.9757 - 1.7016 ln(n options), noulT = 10.732. - Limits: 131,071 tokens per row and 2-255 options per question. Longer rows are refused as
unsupported; nothing is truncated. - Code: compared with FlexDM v1.0,
reader.pyandvllm_reader.pyonly add an optionalsystemoption. This run does not set it, so the prompts are the same as v1.0's.
Training
PEFT LoRA, r 64,
lora_alpha128 during training, dropout 0, targetsq/k/v/o/gate/up/down_projof the 60 text layers, float32 LoRA on bf16 weights. Strength 0.5: the storedlora_alpha64 applies half of the trained change (W + 0.5 · ΔW).One epoch over 115,249 questions (103,956 requests): 1,001 steps of about 62k tokens (62.2M tokens), AdamW, lr 1e-4, warmup then cosine decay, gradient clipping 1.0. Two RTX PRO 6000 Blackwell Max-Q (data parallel), 17 hours.
Rows are rendered exactly as served: the
headerlayout, the 3,000-token read-twice rule, the option order shuffled per question, and one forward pass per request with the request's questions side by side.Loss per question, on the served distribution (softmax of the soft-capped label logits at the serving temperatures): cross-entropy to the gold label (or the source's annotator distribution) + 1.0 · KL(teacher ‖ model) + 0.3 · Brier (+ RPS for rater scales). The teacher is the frozen base model itself:
- for most questions, Gemma read by FlexDM (vLLM FP8), averaged over the original and the reversed option order;
- for the reasoning-heavy questions marked below, Gemma's own answer distribution after thinking (thinking mode on, 2 samples, up to 3,072-4,096 thinking tokens).
No other model is used as a teacher.
Data
Only sources whose licences allow training. No non-commercial or research-only sources, no Jev outputs, no outputs of other entries. Rows carrying a benchmark canary are dropped.
| Part | Questions | What |
|---|---|---|
| tasksource | 64,703 | tasksource/tasksource-jev-typed-decisions, commercial-use rows only: 359 sources, at most 300 per source (100 per procedural family) |
| Knowledge and reasoning with thinking labels | 19,129 | MedQA-USMLE, MedMCQA, HEAD-QA, WikiMedQA, MathQA, AQuA-RAT, SpartQA, CosmosQA, StrategyQA, WikiHop, EXAMS (train splits), with the base model's thinking-mode answers as teacher |
| Self-written by the base model | 6,114 | Judgement questions over realistic documents written by Gemma-4-31B-it itself, kept only where its thinking-mode answer agreed with the intended answer |
| Knowledge multiple choice | 5,319 | CommonsenseQA, QASC, OpenBookQA, AQuA-RAT |
| Generated decisions | 8,505 | Device-control decisions generated with the kit's simulator logic (MIT; random homes, rooms, devices and requests; no state equal to a public test row), and chord questions from POP909 / POP909-CL songs that are not in the public suite (MIT) |
| ver 1.0's own rows | 4,898 | Human-labelled public datasets and decisions generated by our code with computed answers (as in ver 1.0) |
| Teacher only | 3,647 | Questions with the gold removed, trained only toward the base model's distribution |
| Official train splits of suite benchmarks | 2,934 (2.5%) | iSarcasmEval 1,500, GSM8K 1,039, Amazon ESCI 96, HoVer 95, BANKING77 56, WinoGrande 51, New Yorker (matching) 50, CLINC150 47. No test or evaluation split of any suite benchmark is used. |
- Augmentation: "none of the above" answers and irrelevant extra options on a share of rows. Yes/no answer shares were rebalanced per source.
- Decontamination: every training row was checked against the 140,620 rows of the public 0.3 suite, the public JevBench
items and
jgeuter/OpenDecisions(exact strings, word 8-grams, long shared spans, a short-line fuzzy check, benchmark canaries). 524 flagged candidate rows of the new parts were dropped; ver 1.0's rows had been checked the same way.
Selection and disclosures
- The strength (0.5, against 0.3, 0.7 and 1.0) was chosen on public Decision Index items (a 2,000-row stratified sample and fixed subsamples of the suite benchmarks) by a rule written before the results were seen. The low-confidence re-read was checked on the same public sample. The public score is therefore not blind to these choices.
jgeuter/OpenDecisionswas used only as a held-out check (read, never trained on).- The
headerlayout follows wcole3/jev-brain (#193, MIT). Reading twice follows shisa-ai/shisa-de-2.
Results
Decision Index 0.3 public run: 1000luca/FlexDM-LoRA-v2.0-decision-index (runs/flexdm-l2-sub2).
License
The adapter is released under CC BY-SA 4.0, because some training sources are CC BY-SA. The base model is © Google,
Apache 2.0. The code in code/ is MIT (FlexDM).
- Downloads last month
- 24