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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
library_name: peft
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
base_model: Qwen/Qwen3-30B-A3B-Instruct-2507
|
| 9 |
+
base_model_relation: adapter
|
| 10 |
+
tags:
|
| 11 |
+
- macaron
|
| 12 |
+
- a2ui
|
| 13 |
+
- a2ui-v0.8
|
| 14 |
+
- lora
|
| 15 |
+
- peft
|
| 16 |
+
- dynamic-ui
|
| 17 |
+
- structured-generation
|
| 18 |
+
- json-generation
|
| 19 |
+
- grpo
|
| 20 |
+
- qwen3
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Macaron A2UI Tall
|
| 24 |
+
|
| 25 |
+
> This repository contains the LoRA adapter weights for **Macaron A2UI Tall**.
|
| 26 |
+
|
| 27 |
+
Macaron A2UI Tall is a LoRA adapter trained to generate valid **A2UI v0.8** cards from user context. It is designed for dynamic UI generation in personal-agent scenarios, where a model converts conversation context, product state, and available actions into one structured UI card.
|
| 28 |
+
|
| 29 |
+
This release corresponds to **Macaron A2UI Tall**.
|
| 30 |
+
|
| 31 |
+
## Highlights
|
| 32 |
+
|
| 33 |
+
- **A2UI v0.8 card generation**: generates structured UI cards that can be consumed by an A2UI-compatible renderer.
|
| 34 |
+
- **LoRA adapter release**: lightweight adapter weights for continued training, inspection, and adaptation.
|
| 35 |
+
- **Context-aware UI generation**: takes user intent, conversation context, product state, and available actions as input.
|
| 36 |
+
- **GRPO post-training**: this release is produced with GRPO on top of a Qwen3-30B A2UI initialization.
|
| 37 |
+
- **Validation-first design**: outputs should be checked by the provided A2UI v0.8 validator before rendering.
|
| 38 |
+
|
| 39 |
+
## Model Overview
|
| 40 |
+
|
| 41 |
+
| Field | Value |
|
| 42 |
+
| --- | --- |
|
| 43 |
+
| Model family | Macaron A2UI |
|
| 44 |
+
| Variant | Tall |
|
| 45 |
+
| Release name | `Macaron A2UI Tall` |
|
| 46 |
+
| Release type | LoRA adapter |
|
| 47 |
+
| Foundation checkpoint | `Qwen/Qwen3-30B-A3B-Instruct-2507` |
|
| 48 |
+
| Target protocol | A2UI v0.8 |
|
| 49 |
+
| Output format | JSON object with `text_response` and `a2ui` fields |
|
| 50 |
+
| Training method | GRPO with LoRA |
|
| 51 |
+
| Library | PEFT / Transformers |
|
| 52 |
+
| Recommended dtype | bfloat16 |
|
| 53 |
+
| Tokenizer | Same as foundation checkpoint |
|
| 54 |
+
|
| 55 |
+
### Adapter Details
|
| 56 |
+
|
| 57 |
+
| Field | Value |
|
| 58 |
+
| --- | --- |
|
| 59 |
+
| LoRA rank | `16` |
|
| 60 |
+
| LoRA alpha | `32` |
|
| 61 |
+
| LoRA dropout | `0.0` |
|
| 62 |
+
| Target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
|
| 63 |
+
| LM head adapted | `No` |
|
| 64 |
+
| Training max response | `4096` |
|
| 65 |
+
|
| 66 |
+
## Model Variants
|
| 67 |
+
|
| 68 |
+
| Variant | Release Name | Foundation Checkpoint | Release Type |
|
| 69 |
+
| --- | --- | --- | --- |
|
| 70 |
+
| Tall | Macaron A2UI Tall | `Qwen/Qwen3-30B-A3B-Instruct-2507` | LoRA adapter |
|
| 71 |
+
| Grande | Macaron A2UI Grande | `Qwen/Qwen3-235B-A22B-Instruct-2507` | LoRA adapter |
|
| 72 |
+
| Venti | Macaron A2UI Venti | `GLM 5.1` | LoRA adapter |
|
| 73 |
+
|
| 74 |
+
You are currently viewing the **Tall** release.
|
| 75 |
+
|
| 76 |
+
## Quickstart
|
| 77 |
+
|
| 78 |
+
This repository contains adapter weights only. Load the corresponding foundation checkpoint first, then attach this adapter with PEFT.
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 82 |
+
from peft import PeftModel
|
| 83 |
+
import torch
|
| 84 |
+
|
| 85 |
+
base_model_id = "Qwen/Qwen3-30B-A3B-Instruct-2507"
|
| 86 |
+
adapter_id = "mindlab-research/Macaron-A2UI-Tall"
|
| 87 |
+
|
| 88 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 89 |
+
base_model_id,
|
| 90 |
+
trust_remote_code=True,
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 94 |
+
base_model_id,
|
| 95 |
+
torch_dtype=torch.bfloat16,
|
| 96 |
+
device_map="auto",
|
| 97 |
+
trust_remote_code=True,
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
+
model = PeftModel.from_pretrained(base_model, adapter_id)
|
| 101 |
+
model.eval()
|
| 102 |
+
|
| 103 |
+
messages = [
|
| 104 |
+
{
|
| 105 |
+
"role": "system",
|
| 106 |
+
"content": "You are an A2UI v0.8 card generation model. Output exactly one valid A2UI JSON card."
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"role": "user",
|
| 110 |
+
"content": "<USER_CONTEXT_JSON>",
|
| 111 |
+
},
|
| 112 |
+
]
|
| 113 |
+
|
| 114 |
+
text = tokenizer.apply_chat_template(
|
| 115 |
+
messages,
|
| 116 |
+
tokenize=False,
|
| 117 |
+
add_generation_prompt=True,
|
| 118 |
+
)
|
| 119 |
+
|
| 120 |
+
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 121 |
+
|
| 122 |
+
outputs = model.generate(
|
| 123 |
+
**inputs,
|
| 124 |
+
max_new_tokens=2048,
|
| 125 |
+
do_sample=False,
|
| 126 |
+
)
|
| 127 |
+
|
| 128 |
+
response = tokenizer.decode(
|
| 129 |
+
outputs[0][inputs.input_ids.shape[-1]:],
|
| 130 |
+
skip_special_tokens=True,
|
| 131 |
+
)
|
| 132 |
+
|
| 133 |
+
print(response)
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
## Output Contract
|
| 137 |
+
|
| 138 |
+
Macaron A2UI Tall is trained to output:
|
| 139 |
+
|
| 140 |
+
* valid JSON;
|
| 141 |
+
* a top-level object of the form `{"text_response": "...", "a2ui": [...]}`;
|
| 142 |
+
* no Markdown code fences;
|
| 143 |
+
* no extra explanation outside the JSON object;
|
| 144 |
+
* only A2UI actions and components supported by the calling product surface.
|
| 145 |
+
|
| 146 |
+
The `a2ui` field is expected to contain A2UI v0.8 messages such as `beginRendering`, `surfaceUpdate`, `dataModelUpdate`, or `deleteSurface`.
|
| 147 |
+
|
| 148 |
+
The model targets A2UI v0.8. Compatibility with later protocol revisions is not guaranteed without additional validation or fine-tuning.
|
| 149 |
+
|
| 150 |
+
## Evaluation
|
| 151 |
+
|
| 152 |
+
We evaluate Macaron A2UI on internal A2UI v0.8 card-generation benchmarks and product-aligned task suites.
|
| 153 |
+
|
| 154 |
+
Public benchmark numbers and reproduction details are being standardized and will be added in a future revision of this model card.
|
| 155 |
+
|
| 156 |
+
At the moment, this repository should be interpreted as an adapter release first. Evaluation methodology, task definitions, and comparable public results are still being consolidated.
|
| 157 |
+
|
| 158 |
+
## Limitations
|
| 159 |
+
|
| 160 |
+
Macaron A2UI Tall is specialized for A2UI generation and is not intended as a general-purpose chat model.
|
| 161 |
+
|
| 162 |
+
Known limitations:
|
| 163 |
+
|
| 164 |
+
* may generate valid JSON that is still semantically weak;
|
| 165 |
+
* may hallucinate actions if the action space is underspecified;
|
| 166 |
+
* may fail on A2UI versions other than v0.8;
|
| 167 |
+
* requires external validation before production rendering;
|
| 168 |
+
* should not be used for irreversible or safety-critical UI actions without user confirmation.
|
| 169 |
+
|
| 170 |
+
## License
|
| 171 |
+
|
| 172 |
+
The adapter weights are released under MIT.
|
| 173 |
+
|
| 174 |
+
This adapter is trained on top of `Qwen/Qwen3-30B-A3B-Instruct-2507`. Users are responsible for complying with both:
|
| 175 |
+
|
| 176 |
+
1. the adapter license;
|
| 177 |
+
2. the license of the corresponding foundation checkpoint.
|
| 178 |
+
|
| 179 |
+
## Citation
|
| 180 |
+
|
| 181 |
+
```bibtex
|
| 182 |
+
@misc{macaron_a2ui_tall,
|
| 183 |
+
title = {Macaron A2UI Tall},
|
| 184 |
+
author = {Mind Lab},
|
| 185 |
+
year = {2026},
|
| 186 |
+
publisher = {Hugging Face},
|
| 187 |
+
howpublished = {\url{https://huggingface.co/mindlab-research/Macaron-A2UI-Tall}}
|
| 188 |
+
}
|
| 189 |
+
```
|
| 190 |
+
|
| 191 |
+
## Contact
|
| 192 |
+
|
| 193 |
+
contact@mindlab.ltd
|