Gemma4-E4B-Instruct-KD-Model

This is a lightweight multimodal model that Unidocs distilled from Gemma 4 31B into E4B, specialized for Korean chart & table document understanding.
์œ ๋‹ˆ๋‹ฅ์Šค(์ฃผ)์—์„œ Gemma 4 31B ๋ชจ๋ธ์„ E4B๋กœ ๊ฒฝ๋Ÿ‰ํ™”(์ง€์‹์ฆ๋ฅ˜)ํ•˜์—ฌ ํ•œ๊ตญ์–ด ์ฐจํŠธยทํ‘œ ๋ฌธ์„œ ์ดํ•ด์— ํŠนํ™”์‹œํ‚จ ๋ฉ€ํ‹ฐ๋ชจ๋‹ฌ ๋ชจ๋ธ์ž„

Model Description

Lightweight VLM (Vision-Language Model) developed by Unidocs as a result of the "Development of Multimodal RAG-based AI Agent in Offline Environments for Administrative Education Innovation" project under the AI Voucher (Advanced GPU Utilization Support Program), released on July 20, 2026.

A model distilled from a Gemma 4 31B teacher into google/gemma-4-E4B-it (student) via knowledge distillation, trained on Korean public/administrative document chart and table data from AI Hub (aihub.or.kr), performing visual question answering, key-information extraction, and structure recognition over chart and table images with Korean text input/output.

์œ ๋‹ˆ๋‹ฅ์Šค(์ฃผ)์—์„œ AI ๋ฐ”์šฐ์ฒ˜(์ฒจ๋‹จ GPU ํ™œ์šฉ ์ง€์› ์‚ฌ์—…)์˜ "ํ–‰์ • ๊ต์œก ํ˜์‹ ์„ ์œ„ํ•œ ์˜คํ”„๋ผ์ธ ํ™˜๊ฒฝ ๋‚ด ๋ฉ€ํ‹ฐ๋ชจ๋‹ฌ RAG ๊ธฐ๋ฐ˜ AI ์—์ด์ „ํŠธ ๊ฐœ๋ฐœ" ๊ณผ์ œ์˜ ๊ฒฐ๊ณผ๋กœ 2026๋…„ 7์›” 20์ผ ๊ณต๊ฐœํ•จ

google/gemma-4-E4B-it ๋ชจ๋ธ์— Gemma 4 31B๋ฅผ teacher๋กœ ํ•˜๋Š” ์ง€์‹์ฆ๋ฅ˜๋ฅผ ์ ์šฉํ•˜๊ณ , AIHub(aihub.or.kr)์˜ ํ•œ๊ตญ์–ด ๊ณต๊ณตยทํ–‰์ • ๋ฌธ์„œ ์ฐจํŠธ/ํ‘œ ๋ฐ์ดํ„ฐ๋กœ ํ•™์Šตํ•˜์—ฌ ์ฐจํŠธยทํ‘œ ์ด๋ฏธ์ง€์— ๋Œ€ํ•œ ํ•œ๊ตญ์–ด ์งˆ์˜์‘๋‹ต, ํ•ต์‹ฌ์ •๋ณด ์ถ”์ถœ, ๊ตฌ์กฐ ์ธ์‹์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒฝ๋Ÿ‰ VLM(Vision-Language Model) ๋ชจ๋ธ์ž„

Repository Contents / ์ €์žฅ์†Œ ๊ตฌ์„ฑ

This repository contains the base merged model plus three task-specific LoRA adapters. Each evaluation score below is produced by a different configuration โ€” see the Evaluation Results table.

๋ณธ ์ €์žฅ์†Œ๋Š” ๋ณ‘ํ•ฉ ์™„๋ฃŒ๋œ ๊ธฐ๋ณธ ๋ชจ๋ธ๊ณผ ๊ณผ์ œ๋ณ„ LoRA ์–ด๋Œ‘ํ„ฐ 3์ข…์„ ํ•จ๊ป˜ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ ํ‰๊ฐ€ ์ˆ˜์น˜๋Š” ๊ฐ๊ฐ ์„œ๋กœ ๋‹ค๋ฅธ ๊ตฌ์„ฑ์—์„œ ์‚ฐ์ถœ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Path Contents Base
(repo root) Merged model for document QA (bf16, 4 shards) google/gemma-4-E4B-it
adapters/extract-chart/ Key-information extraction adapter google/gemma-4-E4B-it
adapters/chart-structure/ Chart structure recognition adapter this repo
adapters/dpo/ Preference-aligned adapter (table structure path) this repo

Note: adapters/extract-chart is trained on the original google/gemma-4-E4B-it, while the other two are trained on this repository's merged model. Load each adapter on top of its correct base โ€” see "Use with adapters" below.

Intended Uses & Limitations

This model is intended for VQA, key-information extraction, and structure recognition over charts and tables in Korean public/administrative documents, suitable for lightweight offline deployment.

It is specialized for Korean chart/table images, may underperform on other domains or complex reasoning, and outputs may contain errors requiring human verification.

๋ณธ ๋ชจ๋ธ์€ ํ•œ๊ตญ์–ด ๊ณต๊ณตยทํ–‰์ • ๋ฌธ์„œ์˜ ์ฐจํŠธ/ํ‘œ์— ๋Œ€ํ•œ ์งˆ์˜์‘๋‹ต, ํ•ต์‹ฌ์ •๋ณด ์ถ”์ถœ, ๊ตฌ์กฐ ์ธ์‹ ์šฉ๋„์ด๋ฉฐ, ์˜คํ”„๋ผ์ธ ๊ฒฝ๋Ÿ‰ ๋ฐฐํฌ์— ์ ํ•ฉํ•จ. ํ•œ๊ตญ์–ด

์ฐจํŠธยทํ‘œ์— ํŠนํ™”๋˜์–ด ํƒ€ ๋„๋ฉ”์ธ์ด๋‚˜ ๋ณต์žกํ•œ ์ถ”๋ก ์—์„œ๋Š” ์„ฑ๋Šฅ์ด ๋‚ฎ์„ ์ˆ˜ ์žˆ๊ณ , ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์–ด ์‚ฌ๋žŒ์˜ ๊ฒ€์ฆ์ด ํ•„์š”ํ•จ.

Training Data

The model was fine-tuned on publicly available Korean chart and table image-text datasets provided by AI Hub.

All training images and labels are sourced from AI Hub open datasets.

๊ณผํ•™๊ธฐ์ˆ ์ •๋ณดํ†ต์‹ ๋ถ€, ํ•œ๊ตญ์ง€๋Šฅ์ •๋ณด์‚ฌํšŒ์ง„ํฅ์›์—์„œ ๊ด€๋ฆฌํ•˜๊ณ  ์žˆ๋Š” AIHub์˜ ์•„๋ž˜์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•จ

  • 031.์ฐจํŠธ ์ด๋ฏธ์ง€-ํ…์ŠคํŠธ ์Œ ๋ฐ์ดํ„ฐ
  • 032.ํ‘œ ์ด๋ฏธ์ง€-ํ…์ŠคํŠธ ์Œ ๋ฐ์ดํ„ฐ

Training Procedure

This is a fine-tuned model of google/gemma-4-E4B-it, distilled from a Gemma 4-31B teacher on AIHub Korean chart and table datasets.

google/gemma-4-E4B-it ๋ชจ๋ธ์„ Gemma 4 31B teacher๋กœ๋ถ€ํ„ฐ ์ง€์‹์ฆ๋ฅ˜ํ•˜์—ฌ AIHub ํ•œ๊ตญ์–ด ์ฐจํŠธยทํ‘œ ๋ฐ์ดํ„ฐ์…‹์œผ๋กœ ๋ฏธ์„ธ์กฐ์ •ํ•œ ๋ชจ๋ธ์ž„

Evaluation Results

Evaluated on a held-out Korean chart and table evaluation set built from AI Hub 031 (Chart) and 032 (Table) datasets. Evaluation images and source annotations are excluded from all training manifests.

Scoring follows a two-stage protocol: (1) normalized substring match, then (2) semantic equivalence judged by the Gemma 4 31B teacher on items that fail stage 1. Stage 2 is applied because open-ended answers (trends, summaries) are unfairly penalized by substring matching.

ํ‰๊ฐ€์…‹์€ ํ•™์Šต์— ์‚ฌ์šฉ๋œ ๋ชจ๋“  ๋งค๋‹ˆํŽ˜์ŠคํŠธ์—์„œ ์›์ฒœ ํŒŒ์ผยท์ด๋ฏธ์ง€ ๋‹จ์œ„๋กœ ๋ถ„๋ฆฌ(held-out)ํ•˜์—ฌ ๊ตฌ์ถ•ํ•˜์˜€๊ณ , ์ฑ„์ ์€ ์ •๊ทœํ™” ๋ถ€๋ถ„์ผ์น˜(1๋‹จ) โ†’ 31B teacher์˜ ์˜๋ฏธ ๋™์น˜ ํŒ์ •(2๋‹จ) 2๋‹จ๊ณ„ ํ”„๋กœํ† ์ฝœ์„ ๋”ฐ๋ฆ„

Task Metric Score Evaluation Size Configuration
Document Question Answering Accuracy 83.3% 2,000 Base model (repo root)
Key Information Extraction Macro F1 88.6% 2,000 google/gemma-4-E4B-it + adapters/extract-chart
Chart Structure Recognition Accuracy 88.8% 250 This repo + adapters/chart-structure
Table Structure Recognition * Accuracy 85.2% 250 This repo + adapters/dpo + external table detector

* Table structure recognition is a hybrid system result, not model-only performance. Questions asking for exact row/column counts are routed to an external table detector (MinerU-based), mirroring the deployed system. The vision encoder compresses each image into 280 soft tokens, so counting rows in a large table is not reliably solvable by the model alone. Model-only accuracy on this subset is substantially lower. See Limitations and Bias.

Inference speed: 1.19 s/sample on average (NVIDIA B200, batch size 1, 100 samples, bf16 merged model). Measured conservatively โ€” a time-to-first-token pass and a full generation pass are summed, so the prefill cost is counted twice.

All figures above were re-measured on 2026-07-20 with the exact weights published in this repository.

Use with transformers

Starting with transformers >= 5.5.0 , you can run multimodal inference by leveraging the Auto classes with the generate() function.

This model takes an image and text as input, so use AutoProcessor and AutoModelForImageTextToText instead of the text-generation pipeline.

Make sure to update your transformers installation via pip install --upgrade transformers.

from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
import torch

model_id = "unidocs/Gemma4-E4B-Instruct-KD-Model"

processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

image = Image.open("chart.jpg")

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": "์ด ์ฐจํŠธ์—์„œ ๊ฐ€์žฅ ๊ฐ’์ด ํฐ ํ•ญ๋ชฉ์€ ๋ฌด์—‡์ธ๊ฐ€์š”?"},
        ],
    },
]

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

outputs = model.generate(**inputs, max_new_tokens=256, use_cache=True)
generated = outputs[0][inputs["input_ids"].shape[-1]:]
print(processor.decode(generated, skip_special_tokens=True))

Note: Set use_cache=True when generating. For serving, you can use vLLM:

vllm serve unidocs/Gemma4-E4B-Instruct-KD-Model \
    --max-model-len 8192 \
    --limit-mm-per-prompt image=1

Use with adapters / ์–ด๋Œ‘ํ„ฐ ์‚ฌ์šฉ๋ฒ•

Install peft (pip install peft), then load the adapter on top of its correct base model.

Key-information extraction โ€” base is the original google/gemma-4-E4B-it:

from transformers import AutoProcessor, AutoModelForImageTextToText
from peft import PeftModel
import torch

base = AutoModelForImageTextToText.from_pretrained(
    "google/gemma-4-E4B-it", torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(
    base, "unidocs/Gemma4-E4B-Instruct-KD-Model", subfolder="adapters/extract-chart")
processor = AutoProcessor.from_pretrained("unidocs/Gemma4-E4B-Instruct-KD-Model")

Chart structure recognition โ€” base is this repository:

base = AutoModelForImageTextToText.from_pretrained(
    "unidocs/Gemma4-E4B-Instruct-KD-Model", torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(
    base, "unidocs/Gemma4-E4B-Instruct-KD-Model", subfolder="adapters/chart-structure")

Replace the subfolder with adapters/dpo for the preference-aligned variant used in the table structure path. Note that reproducing the reported 85.2% additionally requires the external table detector described above.

Limitations and Bias

  • This model may produce biased or inaccurate results. It should not be solely relied upon for critical decisions based on extracted document values.

  • The model's knowledge is limited to its training data and cut-off date.

  • It may exhibit biases present in the training data, which is centered on Korean public and administrative documents.

  • The model may occasionally produce incorrect or inconsistent information.

  • Exact row/column counting on tables is limited by the vision encoder's soft-token compression, and an external table detector is recommended for such cases. The reported table structure score reflects that hybrid configuration.

  • Open-ended answers (trends, summaries) score poorly under substring matching; the reported figures use a two-stage protocol with semantic judging.

  • Knowledge distillation cannot transfer capabilities that are absent from the teacher model itself.

  • ๋ชจ๋ธ์˜ ์ง€์‹์€ ํ›ˆ๋ จ ๋ฐ์ดํ„ฐ์™€ ๋งˆ๊ฐ์ผ๋กœ ์ œํ•œ๋ฉ๋‹ˆ๋‹ค.

  • ํ›ˆ๋ จ ๋ฐ์ดํ„ฐ๊ฐ€ ํ•œ๊ตญ์–ด ๊ณต๊ณตยทํ–‰์ • ๋ฌธ์„œ ์ค‘์‹ฌ์ด๋ฏ€๋กœ ํ•ด๋‹น ๋„๋ฉ”์ธ์˜ ํŽธํ–ฅ์ด ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ๋ชจ๋ธ์€ ๊ฐ€๋” ์ž˜๋ชป๋˜๊ฑฐ๋‚˜ ์ผ๊ด€๋˜์ง€ ์•Š์€ ์ •๋ณด๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ํ‘œ์˜ ์ •ํ™•ํ•œ ํ–‰ยท์—ด ์นด์šดํŒ…์€ ๋น„์ „ ์ธ์ฝ”๋”์˜ ์†Œํ”„ํŠธํ† ํฐ ์••์ถ• ํ•œ๊ณ„๋กœ ์ œํ•œ์ ์ด๋ฉฐ, ์ด ๊ฒฝ์šฐ ์™ธ๋ถ€ ํ‘œ ๊ฒ€์ถœ๊ธฐ ํ™œ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ๋ณด๊ณ ๋œ ํ‘œ ๊ตฌ์กฐ ์ธ์‹ ์ˆ˜์น˜๋Š” ์ด ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ๊ตฌ์„ฑ ๊ธฐ์ค€์ž…๋‹ˆ๋‹ค.

  • ๊ฐœ๋ฐฉํ˜• ๋‹ต๋ณ€(์ถ”์„ธยท์š”์•ฝ)์€ ๋ถ€๋ถ„์ผ์น˜ ์ฑ„์ ์—์„œ ๋‚ฎ๊ฒŒ ์ธก์ •๋˜๋ฉฐ, ๋ณด๊ณ  ์ˆ˜์น˜๋Š” ์˜๋ฏธ ํŒ์ •์„ ํฌํ•จํ•œ 2๋‹จ ์ฑ„์  ๊ธฐ์ค€์ž…๋‹ˆ๋‹ค.

  • teacher ๋ชจ๋ธ ์ž์ฒด๊ฐ€ ๊ฐ–์ง€ ๋ชปํ•œ ๋Šฅ๋ ฅ์€ ์ฆ๋ฅ˜๋ฅผ ํ†ตํ•ด ์ „๋‹ฌ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

  • ์ด ๋ชจ๋ธ์€ ํŽธํ–ฅ๋˜๊ฑฐ๋‚˜ ๋ถ€์ •ํ™•ํ•œ ๊ฒฐ๊ณผ๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฌธ์„œ์—์„œ ์ถ”์ถœํ•œ ๊ฐ’์„ ์ค‘์š”ํ•œ ์˜์‚ฌ๊ฒฐ์ •์— ์ด ๋ชจ๋ธ์—๋งŒ ์˜์กดํ•ด์„œ๋Š” ์•ˆ ๋ฉ๋‹ˆ๋‹ค.

License and Attribution

This model is a derivative work of google/gemma-4-E4B-it (Apache-2.0, ยฉ Google DeepMind), modified by Unidocs Inc. through knowledge distillation from a Gemma 4 31B teacher and fine-tuning on AI Hub Korean chart/table datasets. The original Apache-2.0 notices of the base model are retained and acknowledged. This derivative is released under CC BY-NC-SA 4.0.

๋ณธ ๋ชจ๋ธ์€ google/gemma-4-E4B-it(Apache-2.0, ยฉ Google DeepMind)์˜ ํŒŒ์ƒ๋ฌผ๋กœ, ์œ ๋‹ˆ๋‹ฅ์Šค(์ฃผ)๊ฐ€ Gemma 4 31B teacher๋กœ๋ถ€ํ„ฐ์˜ ์ง€์‹์ฆ๋ฅ˜ ๋ฐ AI Hub ํ•œ๊ตญ์–ด ์ฐจํŠธยทํ‘œ ๋ฐ์ดํ„ฐ์…‹ ๋ฏธ์„ธ์กฐ์ •์„ ํ†ตํ•ด ๋ณ€๊ฒฝํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์› ๋ฒ ์ด์Šค ๋ชจ๋ธ์˜ Apache-2.0 ๊ณ ์ง€๋ฅผ ์œ ์ง€ยท๋ช…์‹œํ•˜๋ฉฐ, ๋ณธ ํŒŒ์ƒ๋ฌผ์€ CC BY-NC-SA 4.0์œผ๋กœ ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค.

Legal Disclaimer

The model developers and distributors bear no legal responsibility for any consequences arising from the use of this model.

This includes any direct, indirect, incidental, special, punitive, or consequential damages resulting from the model's output.

By using this model, users assume all risks that may arise, and the responsibility for verifying and appropriately using the model's output lies solely with the user.

This model is intended to assist document understanding and information extraction. It should not be used as the sole basis for legal, financial, governmental, or other high-impact decisions without human verification.

This disclaimer applies to the maximum extent permitted by applicable law.

๋ฒ•์  ์ฑ…์ž„ ๋ฉด์ฑ… ์กฐํ•ญ

๋ณธ ๋ชจ๋ธ์˜ ์‚ฌ์šฉ์œผ๋กœ ์ธํ•ด ๋ฐœ์ƒํ•˜๋Š” ๋ชจ๋“  ๊ฒฐ๊ณผ์— ๋Œ€ํ•ด ๋ชจ๋ธ ๊ฐœ๋ฐœ์ž ๋ฐ ๋ฐฐํฌ์ž๋Š” ์–ด๋– ํ•œ ๋ฒ•์  ์ฑ…์ž„๋„ ์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ด๋Š” ๋ชจ๋ธ์˜ ์ถœ๋ ฅ์œผ๋กœ ์ธํ•œ ์ง์ ‘์ , ๊ฐ„์ ‘์ , ์šฐ๋ฐœ์ , ํŠน์ˆ˜ํ•œ, ์ง•๋ฒŒ์  ๋˜๋Š” ๊ฒฐ๊ณผ์  ์†ํ•ด๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ์ž๋Š” ๋ณธ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•จ์œผ๋กœ์จ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ์œ„ํ—˜์„ ๊ฐ์ˆ˜ํ•˜๋ฉฐ, ๋ชจ๋ธ์˜ ์ถœ๋ ฅ์— ๋Œ€ํ•œ ๊ฒ€์ฆ ๋ฐ ์ ์ ˆํ•œ ์‚ฌ์šฉ์— ๋Œ€ํ•œ ์ฑ…์ž„์€ ์ „์ ์œผ๋กœ ์‚ฌ์šฉ์ž์—๊ฒŒ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ณธ ๋ชจ๋ธ์€ ๋ฌธ์„œ ์ดํ•ด ๋ฐ ์ •๋ณด ์ถ”์ถœ์„ ์ง€์›ํ•˜๊ธฐ ์œ„ํ•œ ์šฉ๋„๋กœ ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฒ•๋ฅ ยท๊ธˆ์œตยทํ–‰์ • ๋“ฑ ์ค‘์š”ํ•œ ์˜์‚ฌ๊ฒฐ์ •์—๋Š” ๋ฐ˜๋“œ์‹œ ์‚ฌ๋žŒ์˜ ๊ฒ€์ฆ์„ ๊ฑฐ์ณ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ด ๋ฉด์ฑ… ์กฐํ•ญ์€ ๊ด€๋ จ ๋ฒ•๋ฅ ์ด ํ—ˆ์šฉํ•˜๋Š” ์ตœ๋Œ€ ๋ฒ”์œ„ ๋‚ด์—์„œ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.

Model Card Contact

์œ ์„ (tobewiseys@unidocs.co.kr), ๋‚˜์˜๋ฏผ (ym@unidocs.co.kr), ๊น€ํ™˜์„ (kcss4499@unidocs.co.kr)

Additional Information

For more details about the base model, please refer to the original Gemma4 documentation.

Downloads last month
22
Safetensors
Model size
8B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for unidocs/Gemma4-E4B-Instruct-KD-Model

Finetuned
(340)
this model