Skip to content

Microsoft

AesCode-8B

A 8.2B coding model by Microsoft that uses tools such as web search and reads images.

Coding Tools Vision
Downloads
5,872 downloads last month
Likes
14 likes
Uploaded
Uploaded 11 Oct 2026
Parameters
8,767,123,696 (8.8B)
Context length
262,144 tokens
Architecture
qwen3vl
Task
image-text-to-text
Licence
apache-2.0
Released
29 Sept 2026
Last updated
14 Oct 2026

This is bartowski's upload of microsoft/AesCode-8B, which is based on Qwen/Qwen3-VL-8B-Instruct.

Languages listed in the model card

  • English

Tools

Uses tools, so web search and the browser work best with it.

Vision

Reads images: photos, screenshots, scanned pages.

Each version is the same model stored at a different precision: smaller files use less memory and lose a little quality.

VersionFile sizeFileSHA-256
IQ2_M3.14 GBAesCode-8B-IQ2_M.gguf
Q2_K3.30 GBAesCode-8B-Q2_K.gguf
IQ3_XXS3.68 GBAesCode-8B-IQ3_XXS.gguf
Q3_K_S3.87 GBAesCode-8B-Q3_K_S.gguf
IQ3_XS3.89 GBAesCode-8B-IQ3_XS.gguf
Q3_K_M4.04 GBAesCode-8B-Q3_K_M.gguf
Q3_K_L4.23 GBAesCode-8B-Q3_K_L.gguf
IQ3_M4.48 GBAesCode-8B-IQ3_M.gguf
Show all 22 versions
VersionFile sizeFileSHA-256
IQ4_XS4.69 GBAesCode-8B-IQ4_XS.gguf
Q4_04.87 GBAesCode-8B-Q4_0.gguf
Q4_K_S4.93 GBAesCode-8B-Q4_K_S.gguf
IQ4_NL5.18 GBAesCode-8B-IQ4_NL.gguf
Q4_K_M5.21 GBAesCode-8B-Q4_K_M.gguf
Q4_15.31 GBAesCode-8B-Q4_1.gguf
Q4_K_L5.59 GBAesCode-8B-Q4_K_L.gguf
Q5_K_S5.89 GBAesCode-8B-Q5_K_S.gguf
Q5_K_M6.24 GBAesCode-8B-Q5_K_M.gguf
Q6_K_S6.86 GBAesCode-8B-Q6_K_S.gguf
Q6_K7.14 GBAesCode-8B-Q6_K.gguf
Q6_K_L7.46 GBAesCode-8B-Q6_K_L.gguf
Q8_08.71 GBAesCode-8B-Q8_0.gguf
BF1616.39 GBAesCode-8B-bf16.gguf

Vision add-on (needed to read images): mmproj-AesCode-8B-f16.gguf, 1.16 GB

Model class
Qwen3VLForConditionalGeneration
Model type
qwen3_vl_text
Layers
36
Hidden size
4096
Attention heads
32
Key/value heads
8
Vocabulary
151,936
Context length
262,144 tokens
Weights
bfloat16
Vision encoder
Included (vision_config)

The sampling settings the model's makers ship as its defaults.

Temperature
0.7
Top P
0.8
Top K
20

Papers the model's Hugging Face page links to (the model's own report and papers it cites).

AesCode-8B

AesCode generates information-rich visual artifacts such as slides, posters, and dashboards as HTML/CSS. The output remains structured, editable, and verifiable, but the task poses a distinct challenge: code models cannot see how layout, hierarchy, and color come together on the canvas.

Image generators offer the opposite strength. They compose visually compelling pages but often misrender text, numbers, and logical relationships. AesCode uses an image generated from the same prompt as an aesthetic reference while following the prompt for the required content.

Reference input alone does not solve the problem. Off-the-shelf vision-language models may copy hallucinated content or ignore the reference layout. AesCode separates semantic requirements from visual cues through graph-structured supervision and decoupled cross-modal rewards.

AesCode-8B starts from Qwen3-VL-8B-Instruct and is trained with cold-start SFT followed by GDPO across seven reward channels.

Intended Use

AesCode is designed to generate information-rich visual artifacts as structured HTML/CSS. It is suited for creating editable slides, posters, dashboards, and reports, as well as for research on multimodal code generation and verifiable visual design.

Results

We evaluate on 300 infographic samples. Rule averages the programmatic Text, Bound, and Chart checks. Visual averages the Content, Layout, and Style checklist dimensions. Overall is the mean of Rule and Visual. Scores are percentages averaged over three generations per prompt with no selection.

Ref. indicates whether the model receives an image-generated reference together with the prompt. Bold marks the best score in each column and underline the second best.

ModelRef.TextBoundChartRuleContentLayoutStyleVisualOverall
GPT-5.5No88.6786.1882.8585.9079.2768.0952.8066.7276.31
GPT-5.5Yes89.2286.8581.3585.8082.4489.9357.9176.7681.28
Claude Opus 4.8No91.4085.0387.6988.0484.9864.8846.7265.5376.78
Claude Opus 4.8Yes92.4584.4373.7583.5586.4289.7655.5177.2380.39
Qwen3-VL-8BNo58.3277.2343.3059.6138.3323.9713.2225.1742.39
Qwen3-VL-8BYes64.0770.9942.3559.1452.9051.3329.9244.7251.93
Qwen3-VL-32BNo66.0080.3141.3662.5549.8134.8519.3434.6748.61
Qwen3-VL-32BYes71.1979.6150.7767.1962.0464.5938.4355.0261.10
AesCode-8BYes94.0688.3687.7990.0786.4187.8053.2175.8082.94
AesCode-32BYes95.3497.2790.3794.3385.7690.5855.9977.4485.89

AesCode-8B improves Visual over its reference-conditioned Qwen3-VL-8B backbone by 31.1 points and Overall by 31.0. Its Overall score of 82.94 exceeds the reference-conditioned GPT-5.5 and Claude Opus 4.8 results, while Rule reaches 90.07. The visual gains do not come at the expense of verifiable correctness.

Style is the shared ceiling for every system. It awards credit only when a design needs no further visual revision before delivery, and no model clears 60.

Usage

The model follows the Qwen3-VL chat interface and requires transformers>=4.57. Supply a detailed content prompt and, when available, a reference image for layout and style guidance.

from transformers import AutoProcessor, AutoModelForImageTextToText

model_id = "microsoft/AesCode-8B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
    model_id, dtype="auto", device_map="auto"
)

messages = [{
    "role": "user",
    "content": [
        {"type": "image", "image": "reference.png"},
        {"type": "text", "text": "<your content prompt>"},
    ],
}]

inputs = processor.apply_chat_template(
    messages, add_generation_prompt=True, tokenize=True,
    return_dict=True, return_tensors="pt",
).to(model.device)

out = model.generate(
    **inputs, do_sample=True, temperature=0.8, top_p=0.95, max_new_tokens=12000
)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

For batched generation, serve with vLLM and allow two images per prompt:

vllm serve microsoft/AesCode-8B --limit-mm-per-prompt image=2 --max-model-len 24576

Reported scores use three rollouts per prompt at temperature 0.8, top-p 0.95, up to 12,000 output tokens and a 24,576-token context.

The model emits a complete HTML document. Tables use HTML table structures and charts use ECharts specifications, keeping both directly inspectable and verifiable.

The reference image is optional. Reference-conditioned training internalizes visual planning into the policy. Measured on AesCode-8B, withholding the reference at inference costs only 1.00 Visual point, against 19.55 for the Qwen3-VL-8B-Instruct backbone and 10.04 for GPT-5.5. Quality is still highest when a reference is supplied.

The repository provides the training prompt template and a pipeline that turns a short idea into the prompt and reference pair the model expects.

Training

Cold-start SFT. 3,000 demonstrations at learning rate 1e-5.

Reinforcement learning. GDPO over 7,408 prompts for 400 steps, using verl's FSDP-vLLM hybrid engine with no critic and no separately trained reward model. AdamW at a constant 5e-6, no warmup, weight decay 0.01, 128 prompts per step with 8 rollouts each, KL and entropy coefficients both 0.001, rollout temperature 1.0 and top-p 1.0, prompt and response each capped at 8,192 tokens. AesCode-32B uses the same recipe and a longer 520-step run.

The reward is not a single scalar. Each target is represented as a design graph describing the whole canvas, which makes every property individually attributable. From that graph come two complementary reward families: deterministic verifiers score the properties parsable from the code and its rendering, while a VLM judge scores the non-parsable ones using a sample-specific Visual Graph Rubric tied to the graph's elements and relations. These form seven channels: execution, text, boundary, tablechart, layout, whitespace, and design. Each is normalized within its rollout group before aggregation, so a dominant signal cannot drown out a weaker one.

Candidate HTML is scored by rendering it in a sandboxed Playwright browser with external requests blocked, which exports the DOM, computed styles, bounding boxes, console status and a screenshot.

Training code, the verifier stack and the Visual Graph Rubric builder are released at https://github.com/microsoft/AesCode.

Citation

@article{gao2026aescode,
  title   = {AesCode: Aesthetic Code Generation with Decoupled Cross-Modal Rewards},
  author  = {Gao, Xin and Yang, Yifan and Li, Xin and Wang, Pan and Li, Yan and Tian, Muzhao and Cheng, Mingxi and Liu, Bei and Qiu, Kai and Dai, Qi and Chen, Dong and Dong, Yue and Tassiulas, Leandros and Ying, Rex and Li, Ji and Luo, Chong},
  journal = {arXiv preprint arXiv:2610.18860},
  year    = {2026}
}

License

Released under the Apache 2.0 license, following the Qwen3-VL backbone.

More from Microsoft

On Hugging Face

Everything on this page comes from these pages and is refreshed every few hours; Hugging Face always has the latest.