Add EXAONE-MoE implementations
Author: nuxlear
Pull request: yes
Labels: name: New model

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Add EXAONE-MoE architecture for the [K-EXAONE model](https://huggingface.co/LGAI-EXAONE/K-EXAONE-236B-A23B) released by LG AI Research.

This PR adds the modeling code of EXAONE-MoE (K-EXAONE), which is available at the fork of the LG AI Research:
https://github.com/Aim-Highest/transformers
Test code and documentation will be updated.

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker 

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker @Cyrilvallez
- vision models: @yonigozlan @molbap
- audio models: @eustlb @ebezzam @vasqu
- multimodal models: @zucchini-nlp
- graph models: @clefourrier

Library:

- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- continuous batching: @remi-or @ArthurZucker @McPatate
- pipelines: @Rocketknight1
- tokenizers: @ArthurZucker and @itazap
- trainer: @SunMarc
- attention: @vasqu @ArthurZucker @CyrilVallez
- model loading (from pretrained, etc): @CyrilVallez
- distributed: @3outeille @ArthurZucker
- CIs: @ydshieh

Integrations:

- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization: @SunMarc @MekkCyber
- kernels: @MekkCyber @drbh
- peft: @BenjaminBossan @githubnemo

Devices/Backends:

- AMD ROCm: @ivarflakstad
- Intel XPU: @IlyasMoutawwakil
- Ascend NPU: @ivarflakstad 

Documentation: @stevhliu

Research projects are not maintained and should be taken as is.

 -->


Comments:
View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=43080&sha=e7d79e

@nuxlear just ping me again when it's ready for review

@vasqu I think it's ready for review, but `make fix-repo` does not seem to be consistent. (it adds extra tabs after overwriting the `configuration_exaone_moe.py`, which makes a CI failure)

You can ping me when it's ready for review

Should I update the test code with a dummy model? I think everything else is ready.

> Should I update the test code with a dummy model? I think everything else is ready.

Yes, please :pray: taking a look in a second then

It seems the current dummy model needs to be updated, so I’ll notify you when it’s ready.

Also sorry about the CI, it's still flaky here and there but it should be more stable on main

I’ve updated the dummy test model and the docstrings.
Could you please do a final check? @vasqu 

@ArthurZucker @Rocketknight1 could you kindly review this PR? 

Yes!

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_43080). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

run-slow: exaone4, exaone_moe

This comment contains `run-slow`, running the specified jobs: 

models: ["models/exaone4", "models/exaone_moe"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/21598398619)

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [b1f6aff2](https://github.com/huggingface/transformers/commit/b1f6aff2073c3e0ee7335a90d35c71dc57eba118) | merge commit |
| PR | [0e1e5bc6](https://github.com/nuxlear/transformers/commit/0e1e5bc6ca95da30982e4c9374342767b5f2425e) | branch commit |
| main | [751cff7c](https://github.com/huggingface/transformers/commit/751cff7c2cf564e551f6a779970a0ee285f90cdf) | base commit |

### Model CI Report

❌ **[7 new failed tests from this PR](https://huggingface.co/datasets/hf-internal-testing/transformers_pr_ci/raw/2956c4dcc8586251b3572100bd618c848cf5f8f3/2026-02-02/runs/27987-21598398619/ci_results_run_models_gpu/new_failures_with_bad_commit.json)** 😭

- [exaone4](https://github.com/huggingface/transformers/actions/runs/21598398619/job/62237486981):
    tests/models/exaone4/test_modeling_exaone4.py::Exaone4ModelTest::test_generate_compilation_all_outputs
    tests/models/exaone4/test_modeling_exaone4.py::Exaone4ModelTest::test_generate_compile_model_forward_fullgraph

- [exaone_moe](https://github.com/huggingface/transformers/actions/runs/21598398619/job/62237486927):
    tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeModelTest::test_cpu_offload
    tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeModelTest::test_disk_offload_bin
    tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeModelTest::test_disk_offload_safetensors
    tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeIntegrationTest::test_model_generation_beyond_sliding_window_flash
    tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeIntegrationTest::test_model_logits



run-slow: exaone4, exaone_moe

This comment contains `run-slow`, running the specified jobs: 

models: ["models/exaone4", "models/exaone_moe"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/21601384772)

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [24f1d500](https://github.com/huggingface/transformers/commit/24f1d50099beff984f838bcc422e212cd7d4ebd3) | merge commit |
| PR | [1b3b159f](https://github.com/nuxlear/transformers/commit/1b3b159f89d7834b3497bdfd43ce9a7e6d9585f0) | branch commit |
| main | [78e4f885](https://github.com/huggingface/transformers/commit/78e4f885286fc8c811685c5a59178e579b9e5879) | base commit |

### Model CI Report

❌ **[1 new failed tests from this PR](https://huggingface.co/datasets/hf-internal-testing/transformers_pr_ci/raw/6a484812949decb9b3e25d56f91469b79b9a4dea/2026-02-02/runs/27999-21601384772/ci_results_run_models_gpu/new_failures_with_bad_commit.json)** 😭

- [exaone_moe](https://github.com/huggingface/transformers/actions/runs/21601384772/job/62248818167):
    tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeIntegrationTest::test_model_logits



**[For maintainers]** Suggested jobs to run (before merge)

run-slow: auto, exaone4, exaone_moe

run-slow: exaone_moe

This comment contains `run-slow`, running the specified jobs: 

models: ["models/exaone_moe"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/21638245347)

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [7910da44](https://github.com/huggingface/transformers/commit/7910da44fed94ceef850eadb6d753a710a72a441) | merge commit |
| PR | [87f6ca4f](https://github.com/nuxlear/transformers/commit/87f6ca4f631cf1496876d5c484a2603b1fbde169) | branch commit |
| main | [01e860eb](https://github.com/huggingface/transformers/commit/01e860ebc6b827c88e2d75e70864d1b618364653) | base commit |

✅ No failing test specific to this PR 🎉 👏 !