- ExtGemma4-44B
- 🇰🇷 한국어
- ExtGemma4-44B (Gemma4-31B 2차 레이어 확장 모델)
- 🇺🇸 English
- ExtGemma4-44B (2nd-Stage Layer-Expanded Gemma4-31B Model)
🇰🇷 한국어
ExtGemma4-44B (Gemma4-31B 2차 레이어 확장 모델)
모델 카드 (Model Card)
1. 모델 요약 (Model Summary)
ExtGemma4-44B는 1차 레이어 확장 모델인 TOTORONG/extGemma4-41B(80레이어, 한국어 법률·STEM 도메인 파인튜닝 완료본)를 기반으로, 블록 복제(Block Duplication) 확장을 추가 적용하여 80층에서 88층으로 늘린 대규모 언어 모델입니다.
1차 확장이 원본 60층 모델에 신규 레이어를 삽입하는 방식이었다면, 본 모델은 이미 도메인 학습이 끝난 80레이어 모델의 특정 블록을 통째로 복제해 삽입하는 2차 확장 실험으로, 학습된 표현력을 보존하면서 추론 역량(reasoning capacity) 자체를 확장하는 것을 목표로 합니다.
- 개발자: Nextnine (경복대학교 창업보육센터 소속)
- 베이스 모델:
TOTORONG/extGemma4-41B(80레이어,google/gemma-4-31B-it계열) - 모델 크기: 약 47B 파라미터 (2차 확장 후, 실측 46,935,145,520)
- 아키텍처: Gemma4 기반, Hybrid Attention (Sliding + Full)
- 라이선스: 기본 모델 및 사용 데이터셋의 라이선스를 따름 (비상업적 연구 목적 권장)
2. 제작 목적 및 용도 (Intended Use)
Primary Use Cases
- 한국어 법률 문서 이해 및 추론: 민사법 등 법률 분야의 질의응답, 문서 요약, 판례 분석
- STEM 분야 심화 추론: 수학, 과학, 기술 문제 해결 및 설명 생성, GPQA-Diamond류 고난도 벤치마크 대응
- 레이어 확장 방법론 연구: 이미 파인튜닝된 모델에 대한 블록 복제 확장이 추론 능력에 미치는 영향 검증
Limitations
- 본 모델은 연구 및 평가 목적으로 제작되었으며, 실제 법률 자문 또는 의료/금융 등 고위험 분야에 사용해서는 안 됩니다.
- 1차 확장(80레이어) 대비 레이어가 추가로 늘어나 추론 속도 및 메모리 사용량이 더 증가합니다.
- 복제 삽입된 Full Attention 레이어(L55)는 Sliding 레이어 대비 학습 중 활성화(수렴) 속도가 느릴 수 있어, 초기 배포 버전은 해당 레이어의 기여도가 상대적으로 낮을 수 있습니다.
- 한국어 외 다른 언어에 대한 성능은 보장되지 않습니다.
3. 아키텍처 상세 (Architecture Details)
3.1 레이어 삽입 + 블록복제 2차 확장 설계 (Block Duplication, B5 복제)
1차 확장으로 도메인 학습까지 완료된 80레이어 모델(gemma4_80_bench_merged)의 블록 5(B5, 레이어 40~47)를 통째로 복제하여 B5와 B6 사이에 삽입, 총 88레이어로 확장했습니다.
80레이어 → 88레이어 (B5 블록 복제 삽입)
...B4] [B5: L40~47] [B6: L48~55(원본 기준)]...
↓ B5 복제
...B4] [B5: L40~47] [B5': L48~55(신규 삽입)] [B6: L56~63]...
- 삽입 레이어 인덱스 (총 8개, 연속 블록):
{48, 49, 50, 51, 52, 53, 54, 55} - 삽입 블록 내 Full Attention 위치:
L55(블록 마지막 층 — 신규로 zero-init 대상이 된 최초의 Full 레이어) - Full Attention 전체 위치 (총 11개):
[7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87] - Sliding Window 크기: 1024 (변경 없음)
- 매핑 로직: 삽입 지점(48) 이후의 모든 레이어는
src_idx = new_idx - 8단일 공식으로 원본 인덱스에 매핑됨 (복제 블록과 시프트된 후속 블록을 동시에 해결)
3.2 초기화 전략 (Identity Initialization)
1차 확장에서 확립한 3요소 항등 초기화 규칙을 그대로 적용했으며, 이번 확장에서는 Full Attention 레이어가 최초로 zero-init 대상에 포함되었습니다.
- Zero-Initialization:
self_attn.o_proj.weight→ 0mlp.down_proj.weight→ 0
- Gemma4 특수 보정:
- 삽입 레이어의
layer_scalar파라미터를 1.0으로 설정 (기본값 0.0654).- Gemma4 forward 마지막 연산
hidden_states *= layer_scalar특성상, 이 값이 1이 아니면 잔차 경로가 왜곡됨.
- Gemma4 forward 마지막 연산
- 삽입 레이어의
- Full 레이어(L55) 특이사항:
- Full Attention은
v_proj가 없는 구조(Shared KV)이지만,o_proj/down_proj/layer_scalar는 동일하게 보유하므로 Sliding 레이어와 동일한 3요소 규칙으로 항등화 가능함을 확인.
- Full Attention은
- 검증 완료: 확장 직후 80레이어 모델과의 logit 차이는
0.000e+00으로, 8개 삽입 레이어 전부(Full 포함)에서 항등 함수가 정확히 구현되었음을 확인했습니다.
3.3 주요 변경 사항 (Config)
text_config.num_hidden_layers: 80 → 88text_config.layer_types: 88개 배열 (Full 11개 포함)model.safetensors.index.json: 숫자 정렬 적용 (GGUF 변환 시 블록 순서 보장, 1차 확장에서 발견된 사전식 정렬 버그 방지 로직 재사용)
3.4 확장 방식 비교
| 방식 | 레이어 수 | 삽입 수 | 베이스 | Full 비율 | 비고 |
|---|---|---|---|---|---|
| Option B (1차) | 80 | 20 | 60L 원본 | 12.5% | 원본 모델에 신규 레이어 삽입 |
| 블록 복제 B5 (2차) | 88 | 8 | 80L 도메인학습 완료본 | 12.5% | 학습된 표현 위에 블록 복제 삽입 |
모든 방식이 동일한 3요소 초기화 규칙(o_proj=0, down_proj=0, layer_scalar=1.0)을 공유합니다.
4. 학습 (Training)
4.1 학습 설정
- 방식: QLoRA (rank=192), DDP 분산 학습
- Trainable Parameters: 2,196,153,344 / 46,935,145,520 (전체의 4.6791%)
4.2 삽입 레이어 학습 검증
블록 복제로 삽입된 Full Attention 레이어(L55)가 나머지 7개 Sliding 레이어(L48~L54)와 유사한 속도로 학습되는지를 아래 세 가지 방법으로 교차 검증했습니다.
- LoRA 어댑터 B-matrix 노름(norm) 비교
- 병합 가중치의 0으로부터의 편차(deviation) 측정
- Forward-pass 시 hook을 통한 잔차 기여도(residual contribution) 측정
종합판정 결과
| 지표 | full(L55) vs sliding 삽입 평균 | 판정 |
|---|---|---|
| [A] LoRA adapter 크기 | o_proj 112.6%, down_proj 101.0% | Full레이어가 동등 이상 학습됨 |
| [B] 병합 후 실제 가중치 | sliding 범위 내 자연스럽게 위치 | 정상범위(2~3×10⁻⁴) 안착 |
| [C] forward 실전 기여도 | 9.97% vs 7.71% (1.29배) | full이 오히려 더 활발하게 기여 |
세 지표가 일관되게 성공적인 병합을 가리킴
5. 학습 데이터 (Training Data)
| 데이터셋 | 출처 | 용도 |
|---|---|---|
| 민사법 LLM 사전학습 데이터 | AIHub (https://aihub.or.kr) | 법률 도메인 적응형 사전학습 (1차 확장 단계에서 상속) |
| 민사법 Instruction Tuning 데이터 | AIHub | 법률 QA 및 추론 튜닝 (1차 확장 단계에서 상속) |
| MMLU-Pro | TIGER-Lab/MMLU-Pro (HuggingFace) | 다중 분야 추론 평가 |
| CLiCK | EunsuKim/CLiCK (HuggingFace) | 한국어 대화 및 지식 추론 데이터 |
| GPQA-Diamond | fingertap/GPQA-Diamond (HuggingFace) | 고난도 STEM 추론 벤치마크 |
참고: 데이터셋별 라이선스 및 이용 조건은 각 데이터셋의 원본 페이지를 따릅니다.
6. 평가 및 성능 (Evaluation)
- 본 모델은 GPQA-Diamond 등 고난도 STEM 추론 벤치마크에서 1차 확장(80레이어) 모델 대비 개선을 목표로 합니다.
- Full Attention 레이어 추가 삽입이 장문 컨텍스트 및 복합 추론 과제에 미치는 영향을 중점적으로 평가할 예정입니다.
- 벤치마크 오염(contamination) 여부와 실제 추론 능력 향상을 구분하기 위한 추가 검증이 진행 중입니다.
7. 사용 방법 (Usage)
7.1 권장 실행 파라미터 (Inference)
--temp 1.0 \
--top-p 0.95 \
--top-k 64 \
--min-p 0.00
7.2 Transformers 예제
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "Nextnine/ExtGemma4-44B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
inputs = tokenizer("한국의 민법 제1조는 무엇인가요?", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=1.0, top_p=0.95, top_k=64)
print(tokenizer.decode(outputs[0]))
7.3 llama.cpp (GGUF) 사용 예시
./llama-cli -m ExtGemma4-44B.gguf -p "민법상 계약의 성립 요건을 설명해주세요." -n 512 --temp 1.0 --top-p 0.95 --top-k 64
8. 라이선스 및 사용 제한 (License & Restrictions)
- 본 모델은 학술 연구 및 비상업적 목적으로만 사용할 것을 권장합니다.
- 모델 및 데이터셋의 라이선스는 각각의 원본 저작권자 및 배포처의 조건을 따릅니다.
- 베이스 모델:
google/gemma-4-31B-it(Google Gemma 라이선스) - 데이터셋: 각 데이터셋 페이지에 명시된 라이선스 준수 (명시되지 않은 경우 원저자의 의도를 존중하여 연구/비상업적 용도로 제한)
- 베이스 모델:
- 본 모델은 실제 법률 자문, 의료 진단, 금융 결정 등에 사용될 수 없습니다.
9. 인용 (Citation)
@misc{nextnine_extgemma4_44b_2026,
author = {Nextnine (Kyungbok University Startup Incubator)},
title = {ExtGemma4-44B: Block-Duplication Layer-Expanded Gemma4 for Korean Legal and STEM Reasoning},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/Nextnine/ExtGemma4-44B}
}
10. 문의 (Contact)
- 개발자: Nextnine (경복대학교 창업보육센터)
- 이메일: (추후추가)
- GitHub: (추후추가)
모델 카드 버전: 1.0 (2026년 7월)
🇺🇸 English
ExtGemma4-44B (2nd-Stage Layer-Expanded Gemma4-31B Model)
Model Card
1. Model Summary
ExtGemma4-44B is a large language model built on top of the first-stage layer-expanded model TOTORONG/extGemma4-41B (80 layers, already fine-tuned on Korean legal and STEM domains), to which a Block Duplication expansion was further applied, growing the model from 80 to 88 layers.
While the first-stage expansion inserted new layers into the original 60-layer model, this model represents a second-stage experiment in which an entire block of an already domain-fine-tuned 80-layer model is duplicated and inserted. The goal is to expand the model's reasoning capacity itself while preserving the representational power already learned during fine-tuning.
- Developer: Nextnine (Kyungbok University Startup Incubator)
- Base model:
TOTORONG/extGemma4-41B(80 layers, derived from thegoogle/gemma-4-31B-itlineage) - Model size: ~47B parameters after the 2nd-stage expansion (measured: 46,935,145,520)
- Architecture: Gemma4-based, Hybrid Attention (Sliding + Full)
- License: Follows the license terms of the base model and the datasets used (non-commercial research use recommended)
2. Intended Use
Primary Use Cases
- Korean legal document understanding and reasoning: QA, document summarization, and case-law analysis in domains such as civil law
- Advanced STEM reasoning: Solving and explaining problems in math, science, and engineering, and handling high-difficulty benchmarks such as GPQA-Diamond
- Layer-expansion methodology research: Investigating how block-duplication expansion applied to an already fine-tuned model affects reasoning ability
Limitations
- This model is intended for research and evaluation purposes only and must not be used for actual legal advice or high-stakes domains such as medicine or finance.
- Compared to the first-stage 80-layer expansion, the additional layers further increase inference latency and memory usage.
- The duplicated Full Attention layer (L55) may converge (activate) more slowly during training than the Sliding layers, so its contribution may be relatively low in early deployment versions.
- Performance in languages other than Korean is not guaranteed.
3. Architecture Details
3.1 Second-Stage Design: Layer Insertion + Block Duplication (B5 Duplication)
Block 5 (B5, layers 40–47) of the 80-layer model that had already completed domain fine-tuning (gemma4_80_bench_merged) was duplicated in its entirety and inserted between B5 and B6, expanding the model to a total of 88 layers.
80 layers → 88 layers (B5 block duplication insertion)
...B4] [B5: L40-47] [B6: L48-55 (original indexing)]...
↓ Duplicate B5
...B4] [B5: L40-47] [B5': L48-55 (newly inserted)] [B6: L56-63]...
- Inserted layer indices (8 total, contiguous block):
{48, 49, 50, 51, 52, 53, 54, 55} - Full Attention position within the inserted block:
L55(last layer of the block — the first Full-Attention layer ever subjected to zero-init) - All Full Attention positions (11 total):
[7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87] - Sliding window size: 1024 (unchanged)
- Mapping logic: every layer after the insertion point (48) is mapped to its original index via the single formula
src_idx = new_idx - 8, which simultaneously resolves both the duplicated block and the shifted subsequent blocks.
3.2 Initialization Strategy (Identity Initialization)
The three-factor identity-initialization rule established during the first-stage expansion was applied unchanged. In this expansion, however, a Full Attention layer was included in zero-init for the first time.
- Zero-initialization:
self_attn.o_proj.weight→ 0mlp.down_proj.weight→ 0
- Gemma4-specific correction:
- The
layer_scalarparameter of inserted layers is set to 1.0 (default 0.0654).- Because Gemma4's forward pass ends with
hidden_states *= layer_scalar, any value other than 1 distorts the residual pathway.
- Because Gemma4's forward pass ends with
- The
- L55 (Full) peculiarity:
- Full Attention lacks a
v_proj(shared-KV structure), but it retainso_proj,down_proj, andlayer_scalar, so it can be made identity-preserving using the same three-factor rule as the Sliding layers.
- Full Attention lacks a
- Verification: immediately after expansion, the logit difference from the 80-layer model was
0.000e+00, confirming that all 8 inserted layers (including the Full layer) implement an exact identity function.
3.3 Key Configuration Changes
text_config.num_hidden_layers: 80 → 88text_config.layer_types: an 88-element array (including 11 Full-attention layers)model.safetensors.index.json: numeric sort applied (preserves block ordering during GGUF conversion, reusing the fix for the lexicographic-sort bug discovered in the first-stage expansion)
3.4 Comparison of Expansion Methods
| Method | Layers | Inserted | Base | Full-attn ratio | Notes |
|---|---|---|---|---|---|
| Option B (1st stage) | 80 | 20 | Original 60L | 12.5% | New layers inserted into the original model |
| Block Duplication B5 (2nd stage) | 88 | 8 | Fine-tuned 80L | 12.5% | Block duplicated on top of already fine-tuned representations |
All methods share the same three-factor initialization rule (o_proj=0, down_proj=0, layer_scalar=1.0).
4. Training
4.1 Training Setup
- Method: QLoRA (rank=192), DDP distributed training
- Trainable parameters: 2,196,153,344 / 46,935,145,520 (4.6791% of total)
4.2 Verification of Inserted-Layer Training
Whether the duplicated Full Attention layer (L55) trained at a comparable rate to the other 7 Sliding layers (L48–L54) was cross-verified using three methods:
- Comparison of LoRA adapter B-matrix norms
- Deviation of merged weights from zero
- Residual contribution measured via forward-pass hooks
Overall Verdict
| Metric | full (L55) vs. average of inserted sliding layers | Verdict |
|---|---|---|
| [A] LoRA adapter magnitude | o_proj 112.6%, down_proj 101.0% | Full layer trained at least as much |
| [B] Actual merged weights | Falls naturally within the sliding-layer range | Settled in the normal range (2–3×10⁻⁴) |
| [C] Real forward-pass contribution | 9.97% vs. 7.71% (1.29×) | Full layer contributes even more actively |
All three metrics consistently indicate a successful merge.
5. Training Data
| Dataset | Source | Purpose |
|---|---|---|
| Civil Law LLM pretraining data | AIHub (https://aihub.or.kr) | Domain-adaptive pretraining for the legal domain (inherited from the first-stage expansion) |
| Civil Law instruction-tuning data | AIHub | Legal QA and reasoning tuning (inherited from the first-stage expansion) |
| MMLU-Pro | TIGER-Lab/MMLU-Pro (Hugging Face) | Multi-domain reasoning evaluation |
| CLiCK | EunsuKim/CLiCK (Hugging Face) | Korean conversational and knowledge-reasoning data |
| GPQA-Diamond | fingertap/GPQA-Diamond (Hugging Face) | High-difficulty STEM reasoning benchmark |
Note: License and usage terms for each dataset follow the original dataset page.
6. Evaluation
- This model targets improvement over the first-stage (80-layer) model on high-difficulty STEM reasoning benchmarks such as GPQA-Diamond.
- Evaluation will focus on how the additional inserted Full Attention layer affects long-context and compound reasoning tasks.
- Further verification is underway to distinguish genuine reasoning improvement from benchmark contamination.
7. Usage
7.1 Recommended Inference Parameters
--temp 1.0 \
--top-p 0.95 \
--top-k 64 \
--min-p 0.00
7.2 Transformers Example
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "Nextnine/ExtGemma4-44B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
inputs = tokenizer("What is Article 1 of the Korean Civil Act?", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=1.0, top_p=0.95, top_k=64)
print(tokenizer.decode(outputs[0]))
7.3 llama.cpp (GGUF) Example
./llama-cli -m ExtGemma4-44B.gguf -p "Explain the requirements for the formation of a contract under civil law." -n 512 --temp 1.0 --top-p 0.95 --top-k 64
8. License & Restrictions
- This model is recommended for academic research and non-commercial purposes only.
- The licenses of the model and datasets follow the terms of their respective original rights holders and distributors.
- Base model:
google/gemma-4-31B-it(Google Gemma License) - Datasets: comply with the license stated on each dataset's page (where unspecified, usage is restricted to research/non-commercial purposes out of respect for the original authors' intent)
- Base model:
- This model must not be used for actual legal advice, medical diagnosis, financial decisions, or similar purposes.
9. Citation
@misc{nextnine_extgemma4_44b_2026,
author = {Nextnine (Kyungbok University Startup Incubator)},
title = {ExtGemma4-44B: Block-Duplication Layer-Expanded Gemma4 for Korean Legal and STEM Reasoning},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/Nextnine/ExtGemma4-44B}
}
10. Contact
- Developer: Nextnine (Kyungbok University Startup Incubator)
- Email: (to be added)
- GitHub: (to be added)
Model card version: 1.0 (July 2026)
- Downloads last month
- -