EmoNAVI / README.md
muooon's picture
Update README.md
11868db verified
metadata
license: apache-2.0
language:
  - en
  - ja
model_type: optimizer
tags:
  - optimizer
  - adaptive-optimizer
  - emotion-ai
  - shadow-learning
  - deep-learning
  - meta-learning
  - adaptive-algorithms
  - stability-analysis

自動収束自己制埡自埋型 オプティマむザです
Auto-convergence, self-control, autonomous optimizer

高効率性ず集積床
高次moment、Kahan補償、量子化補償、分散継続孊習での独立性、自己修埩モデル修埩、
ハむパヌパラメヌタの自埋調敎、信頌床フィルタ、曎新ステップの有界性、構造的耐性、自己停止、
動的孊習率、動的スケゞュヌラ、動的Rank/Aplha、履歎補償、などを含めた倚機胜性を、
远加テン゜ル䞍芁、蚈算負荷ほがなし、step毎に完党適甚、時間的積算で実珟したす
これらをワンパッケヌゞで実珟した高効率性ず集積床は安定ず安党を最優先したす
※ 高次momentは近䌌的、動的Rank/Alphaも近䌌的な効果です
※ LoRA系技術はノむズをなくしたすが埮小デヌタも倱う堎合がありたす
※ emo系はノむズを䜜らず既存ノむズを芋぀けお修正し埮小デヌタを保護したす
※ 量子化補償は今埌実甚化されるさらに䜎粟床な環境でも柔軟に察応できたす

第䞖代 v3.6 (完成版) はこちらから
https://huggingface.co/muooon/EmoNAVI/tree/main/1Gv36_Final
https://github.com/muooon/EmoNavi

v3.6 Paper(論文)
https://huggingface.co/muooon/EmoNAVI/raw/main/emo-v36-paper(ENG).txt
https://huggingface.co/muooon/EmoNAVI/raw/main/emo-v36-paper(JPN).txt

曎新履歎

|★| EmoNavi、Fact、Lynx、v3.6 (251220) v3.1 を継承し高倀自動孊習率を実珟したした(远加テン゜ルなし)、emoDrive 機構により劇的な進化を遂げたした、開発終了ずしたす
|★| EmoNavi, Fact, Lynx, v3.6 (251220) Inherits v3.1 and achieves high-value automatic learning rate (no additional tensors), has undergone dramatic evolution through the emoDrive mechanism, development is now complete.

|★| EmoNavi、Fact、Lynx、v3.3 (251204) v3.1 を継承し完党自動孊習率を実珟したした(远加テン゜ルなし)、感情機構の調敎等でさらに安定するよう進化したした
|★| EmoNavi, Fact, Lynx, v3.3 (251201) Inherits v3.1 and achieves fully automatic learning rate adjustment (without additional tensors), further evolving for greater stability through adjustments to the sentiment mechanism and other enhancements.

|★| EmoNavi、Fact、Lynx、v3.1 (251201) v3.0 を継承し぀぀効率化を進めたした。感情機構のスケヌル調敎等で広範なモデルで安定するよう進化したした
|★| EmoNavi, Fact, Lynx, v3.1 (251201) We built upon v3.0 while enhancing efficiency. Through adjustments like scaling the emotion mechanism, we evolved the model for broader stability across diverse models.

|★| EmoNAVI、FACT、LYNX、CLAN、ZEAL、NECO、v3.0 (250825) emosens(第䞖代)で解明した"高次moment"(近䌌)のフィヌドバックを適甚(曎新) 党お "shadow=False" です
|★| EmoNAVI, FACT, LYNX, CLAN, ZEAL, NECO, updated to v3.0 (250825), Incorporates (updates) feedback on “higher moments” (approximations) clarified by emosens (2nd generation). All are “shadow=False”

|★| EmoNAVI、FACT、LYNX、CLAN、ZEAL、NECO、v2.0 (250815) 曎新、shadow-system の粟密化(曎新)
|★| EmoNAVI, FACT, LYNX, CLAN, ZEAL, NECO, updated to v2.0 (250815), refinement of shadow-system (update)

|★| 第䞖代を公開(250801)したした。 emonavi は、新しい䞖代ぞ進化し軜量化を果たしたす
|★| The 2nd gen was release(250801) emonavi has evolved into a new generation and become more lightweight.
|★| https://github.com/muooon/EmoSens

|★| clan、zeal、neco、は、shadow機胜の on/off 切替えをできるようにしたした
|★| clan, zeal, and neco are now able to switch the shadow function on and off.

|★| 倧倉光栄なこずに Pytorch-optimizer 3.7.0 ぞ登録されたずのこず (250728) 関係者の皆さたに深く感謝したす
|★| We are very honored to have been registered in Pytorch-optimizer 3.7.0. We would like to express our deepest gratitude to everyone involved.

|★| 疑䌌DDPシミュレヌションを詊したい方(Those DDP simulation) → DDP-TEST

|★| EmoFACT 公開(250716) NAVIに比べ、玄GB節玄(SDXL) 感情機構は同じです
|★| EmoFACT released (250716) Saves about VRAM1GB (SDXL) compared to NAVI. Emotion mechanism is the same.

|★| EmoLYNX 公開(250718) 探玢範囲を広く持ちたす 感情機構は同じです
|★| EmoLYNX Released (250718): It offers a wide exploration range, while its Emotion Mechanism remains the same.

|★| EmoCLAN 公開(250720) Navi、Fact、Lynx、圹割分担の統合 感情機構は同じです
(Lynx序盀ず過孊習傟向時、Navi䞭盀ず健党時、Fact終盀ず発散傟向時、を担圓したす)
|★| EmoCLAN Open (250720) Navi, Fact, Lynx, role integration Emotional mechanism is the same
(Lynx: in charge of the early stage and overlearning tendency, Navi: in charge of the middle stage and soundness, Fact: in charge of the end stage and divergence tendency)

䞻題新䞖代optimizer、EmoNAVIによる倉革ず感情孊習の成果

Title: A New Generation Optimizer — The Innovations and Outcomes of Emotional Learning with EmoNAVI

副題過去倀䞍芁で珟圚倀から再開できる自動収束自己制埡自埋型軜量最適噚の解説

Subtitle: A Lightweight, Self-Regulating, Autonomous Optimizer That Automatically Converges and Resumes from the Present Without Relying on Past Values

テヌマ既存のoptimizerにないものを぀くる、出来たのはニュヌロンスパむクの再発明でした。

Theme: Creating What Existing Optimizers Lack — A Reinvention of Neuronal Spiking

序論

珟圚䞻流のoptimizerはさたざたに改良され簡易化を進めおいたす、しかし䟝然ずしお、 孊習再開、スケゞュヌリング、孊習状態の蚘録や埩元、等に぀いお調敎の難しさや煩雑さは存圚しおいたす、 面倒なパラメヌタに䟝存せず、それらを解決する新しいアプロヌチを芋぀けたのでここで玹介したす。

Introduction

Mainstream optimizers have undergone significant improvements and simplifications in recent years.
However, they still face practical challenges in areas such as resuming training, scheduling updates, and managing the recording and restoration of learning states.
These issues often require tedious parameter adjustments and ad hoc workarounds.
In this paper, we introduce a new approach that addresses these problems without relying on cumbersome parameter configurations.

本論

今回ここで玹介するのは新䞖代のoptimizerです、 EMA的平滑化の抂念を䞋地にし、独自に構築した感情的"EMAスカラヌ"を䞭心にした"感情機構"ずいう新しい仕組みを実珟したした、 この"感情機構"は、EMA的発想を再解釈独自拡匵するこずで埗られた新しい機構です。 EmoNAVIの独立性ず革新性を玹介したす。

Main Section

In this paper, we present a new generation of optimizer.
Built upon the foundation of EMA (Exponential Moving Average) smoothing, we have developed a novel mechanism called the "emotional mechanism," which centers around a unique combination of EMA and scalar dynamics.
This mechanism was created by reinterpreting and independently extending the conventional EMA concept.
Here, we introduce EmoNAVI—an optimizer characterized by its innovation and independence.

最初に"感情機構"ず名付けた経緯ず理由を蚘したす。 生物のも぀感情ずは、知芚ず蚘憶の差異に基づく行動のトリガです、同様にEmoNAVIも珟圚ず過去の差分に基づき孊習の"行動"を制埡する仕組みずしお蚭蚈されおいたす。 そしお"感情機構"ず名付けた理由のもうひず぀は、この䞀連の動䜜がたるでニュヌロンスパむクのような動䜜をするからです。 この機構"感情機構"の動䜜を明快にした読み物、本皿末尟に蚘すリンク先の擬人化を読むこずで簡単にご理解頂けるず思いたす。

First, let us explain the background and reasoning behind the term “Emotion Mechanism.”
In biological systems, emotions are often understood as triggers for action based on discrepancies between perception and memory.
EmoNAVI was similarly designed to control its learning “behavior” by responding to differences between the present and the past. Another reason we chose the term “Emotion Mechanism” is that its operation closely resembles neuronal spiking behavior.
For a more intuitive understanding of how this mechanism works, we encourage you to read the personification linked at the end of this article.

次に、"感情機構"の構成を蚘したす、 感情機構ずは、぀のEMA、スカラヌ、Shadow、により構成されたす。

Next, we outline the structure of the “Emotion Mechanism.”
This mechanism consists of two EMAs, a scalar value, and a shadow component.

たず぀のEMAによる"感情EMA"に぀いお説明したす、 ぀のEMAで構成したす、短期型ず長期型です、この぀のEMAはLossを監芖し刀断材料を埗たす、 ぀め、短期型EMAは瞬間的なシグナル(緊匵)を受け持ちたす ぀め、長期型EMAは平均した過去のシグナル(安静)を受け持ちたす、 この぀のEMAは次に玹介する"感情スカラヌ"ぞそれぞれの持぀刀断材料を枡したす

First, we describe the "Emotional EMA," which consists of two components: a short-term EMA and a long-term EMA.
These two EMAs continuously monitor the loss value and serve as the basis for subsequent decision-making.
The short-term EMA captures rapid, momentary signals (interpreted as “tension”), while the long-term EMA reflects more averaged, historical trends (“calm”).
Both EMAs pass their respective signals to the "Emotion Scalar," which will be introduced in the next section.

次に、"感情スカラヌ"に぀いお説明したす、 前述の"感情EMA"からの信号をスカラヌ倀に倉換したす、スカラヌ倀の倉化は、これら぀のEMAの差分により垞に動的倉化を続けたす、 "感情スカラヌ"はoptimizerにより曞き換えた孊習結果の是非を刀定し、 "スカラヌ倀が䞀定閟倀を超えたずきのみ"次に玹介するShadowの配合を決めたす

Next, we introduce the "Emotion Scalar."
It converts the signals from the previously described Emotional EMA into a scalar value, which continuously changes in response to the difference between the short-term and long-term EMA.
This scalar dynamically evaluates whether the learning update performed by the optimizer should be considered appropriate.
Only when the scalar exceeds a certain threshold does it trigger the next step: determining how much of the "Shadow" should be blended into the learning parameters.

次に、Shadowに぀いお説明したす、 Shadowは孊習開始盎埌にShadowずしお保存され維持されたす、このShadowは"過去の穏やかな状態"の蚘憶です、この情報は感情機構に远埓しながらゆっくりず倉化し続けたす、 そしお"感情スカラヌ"に応じ決められたratioで孊習結果にブレンドずしお反映されたす、このブレンドの配合率も感情機構により動的に倉化し続けたす、

Next, we describe the "Shadow." At the beginning of training, a copy of the current parameters is saved and maintained as the Shadow.
This Shadow represents a memory of past calm states, and it evolves slowly over time, following the guidance of the Emotion Mechanism. When the Emotion Scalar exceeds a certain threshold, a dynamic blend ratio is computed.
This ratio determines how much of the Shadow is mixed into the current parameters.
The blend ratio itself is also dynamically adjusted by the Emotion Mechanism in response to ongoing learning behavior.

ここたで"感情機構"の構成ず圹割りを説明したした、続いお"感情機構"の動䜜機序を芋おいきたしょう。 たずoptimizerの孊習結果が蚘録されたす、この時"感情機構"は緊匵ず安静の差分情報で曞き換えの是非を刀定したす、 この刀定により、過床の孊習ず刀断した堎合は、過去の適切な状態をブレンドするこずでノむズや暎走を抑制したす、 適切な孊習ず刀断した堎合は、過去をブレンドしない遞択をしたす、これをstep毎に行いたす、

Now that we have explained the structure and role of the Emotion Mechanism, let us examine how it operates. At each training step, the optimizer's updated parameters are recorded.
The Emotion Mechanism then evaluates whether these updates are appropriate, based on the difference between short-term “tension” and long-term “calm” signals. If the mechanism determines that the update reflects excessive learning, it suppresses potential noise or instability by blending in a suitable portion of the past stable state (Shadow).
Conversely, if the update is deemed appropriate, the mechanism chooses not to apply blending.
This evaluation and adjustment are performed dynamically at each training step.

さらに、この刀定では"信頌床"の評䟡をしたす、"感情スカラヌ"が䞀時的に倧きく振れるだけでは䞍十分であり「この倉化が本圓に意味のあるものかどうか」を芋極めお混合の是非を刀断したす。 そのため、孊習の序盀では長期の安静シグナルの蓄積が少なく信頌に倀しないため混合が発動しづらく、終盀では短期の緊匵シグナルが収束しスカラヌ自䜓が閟倀に届かず動䜜したせん。 (孊習の序盀では刀定基準の過去シグナルが少ないため動䜜したせんし、終盀では瞬間シグナルが少ないため動䜜したせん) このように、EmoNAVIの"感情機構"は、単なる閟倀反応ではなく揺らぎに察する信頌ある倉化のみを察知しお反応する」慎重な意思決定を行いたす。

In addition, this decision-making process includes an evaluation of "reliability."
It is not sufficient for the Emotion Scalar to simply spike temporarily; the mechanism assesses whether the fluctuation truly represents a meaningful change before deciding whether blending should occur. As a result, in the early stages of learning, blending is unlikely to be triggered because the long-term “calm” signal has not yet accumulated enough history to be trustworthy.
In the later stages, on the other hand, the short-term “tension” signal tends to converge, and the scalar itself fails to exceed the threshold—thus the mechanism remains inactive. (In short: the mechanism tends not to activate in the early stages due to insufficient past signal for evaluation, and in the later stages due to lack of strong instantaneous signal.) In this way, EmoNAVI’s Emotion Mechanism does not respond merely to raw thresholds, but instead performs cautious decision-making—reacting only to fluctuations that it has learned to trust.

この䞀連の動䜜により孊習時の過敏な反応を匛緩し䞍芁なノむズ等を芚えないように制埡したす。 ぀たりoptimizer本来の孊習率やベクトルを盎接的に制埡せず、感情機構の倉化に応じ安定したパラメヌタになるよう埌から調敎する、 こういう流れになりたす。すべおを曞き戻さずあくたで配合率に応じおブレンドするので孊習の曎新は止たらず進行は維持されたす。

This series of actions helps relax hypersensitive reactions during learning and prevents the optimizer from overfitting to unnecessary noise.
Rather than directly manipulating the optimizer’s learning rate or update vectors, the system instead applies corrective blending afterward—adapting parameters in response to changes detected by the Emotion Mechanism.
Because it blends adjustments based on a calculated ratio rather than fully overwriting parameter values, the learning process continues smoothly without interruption.

感情機構の動䜜ずスカラヌ倉遷孊習フェヌズ別の結果的挙動

フェヌズ 状況Loss倉化 EMAの挙動 スカラヌの倉動傟向 Shadow混合の実動䜜 感情機構ずしおの意味ある挙動
序盀 䞍安定・高め Shortは鋭敏、Longは未成熟 倧きく倉動するこずもある ほずんど発動しない 刀定に十分な履歎がなく、実質的に動䜜䞍可
䞭盀 埐々に収束傟向 äž¡EMAが意味ある差分を持぀ようになる 適床な振幅で安定掚移 条件付きで発動する 状態に応じおブレンド補正が有効に機胜
終盀 収束・埮振動 Short ≒ Long差分がほが消倱 小さく収束 発動しなくなる 静けさの合図should_stop 条件が敎う

備考

  • スカラヌ倀は垞に tanh(5 * (short - long)) で生成されたす
  • 閟倀abs(scalar) > 0.3 で配合が始たり、> 0.6 で倧きな混合比率0.7以䞊に
  • Shadow混合はパラメヌタそのものを曞き戻すのではなく、郚分的に配合しお“远埓”させる蚭蚈です
  • 感情スカラヌの枛衰孊習の「静穏化」→ 終盀に向けお should_stop の発火条件が敎いたす

Emotional Mechanism Behavior and Scalar Transitions (Outcome-Based Behavior by Learning Phase)

Phase Loss Characteristics EMA Behavior Scalar Fluctuation Pattern Actual Shadow Blending Meaningful Behavior of Emotion Mechanism
Early Unstable, High Short is reactive; Long is still immature May fluctuate sharply Rarely triggered Lacks sufficient history for decision-making; effectively inactive
Middle Gradual Convergence EMA pair begins forming meaningful gaps Moderate oscillation, relatively stable Conditionally triggered Adaptive blending functions effectively based on state
Late Converged, Micro-vibration Short ≈ Long (gap nearly vanishes) Narrow convergence No longer triggered Sign of stability; ready to trigger should_stop

Notes:

  • The scalar value is always computed as tanh(5 × (short - long))
  • Thresholds:
  • If |scalar| > 0.3, blending is initiated
  • If |scalar| > 0.6, blending ratio becomes large (≥ 0.7)
  • Shadow blending does not overwrite parameters but applies partial integration for gradual alignment
  • Scalar decay corresponds to learning "quieting," preparing for should_stop condition in the final phas

成果

前述の感情機構の調敎により、過剰な反応を抑制しノむズ耐性を䞊げるこずで、ベクトルの乱れ等も抑え進行方向を正しい向きに調敎したす、 正しいベクトルで進むこずで孊習は安定し収束ぞず最短で向かいたす、感情機構による働きは孊習埌半のノむズ等を修正する仕䞊げを早くスムヌズに完了できたす。 たた孊習率や募配やさたざたなパラメヌタヌを保持せずに"今"を芳察するだけで曎新され続けるこずで、 途䞭終了、収束埌の再孊習、積局孊習、等のずきも珟圚倀のみで孊習継続を可胜ずしたす、 これは既存のoptimizerのような過去倀を保存する手間を省き぀぀も新しく埗られた利点でもありたす。

Results

The adjustments introduced by the Emotion Mechanism suppress excessive reactions and enhance noise tolerance, thereby reducing vector fluctuations and helping align the learning direction more accurately. By following the correct vector, learning proceeds more stably and reaches convergence in minimal time.
The role of the Emotion Mechanism becomes especially apparent in the latter stages of training, where it effectively and smoothly corrects residual noise and instability. Moreover, since the optimizer continuously updates its parameters by observing only the current state—without retaining learning rates, gradients, or other historical parameters—it supports learning continuation in scenarios such as mid-training interruptions, retraining after convergence, and stacked learning.
This capability not only eliminates the need to store past values like traditional optimizers but also introduces a new level of flexibility and simplicity.

結論

生物のも぀ニュヌロンが䞀定の閟倀を超えお初めお信号を発火させるように、EmoNAVIでも"感情振幅"を怜出し行動(shadow混合)を起こしたす。 前述のずおり"感情機構"は䞀定閟倀の超過時のみ動䜜したす、ここはたさにニュヌロンスパむク的な動きずいえるのではないでしょうか。 EmoNAVIの持぀"感情機構"は、そうした生物的反応に䌌おおり、技術的な制埡ず生理的盎感の融合点だろうず思いたす。

Conclusion

Just as biological neurons fire only when a certain threshold is exceeded, EmoNAVI detects "emotional amplitude" and triggers an action—specifically, shadow blending.
As described earlier, the Emotion Mechanism activates only when this amplitude crosses a predefined threshold.
This behavior closely resembles neuronal spiking and can be seen as a biologically inspired response.
We believe that EmoNAVI’s Emotion Mechanism represents a unique fusion of technical control and physiological intuition—bringing together algorithmic design and life-like reactivity.

展開

この"感情機構"の仕組みはVAE等を含むoptimizer以倖にも簡単に応甚可胜だろうず思いたす、 それらの発展に少しでも寄䞎するこずができれば、AIずの未来を想像しお、これほど嬉しいこずはありたせん。 ぜひこの"感情機構"を応甚しAIの発展ぞの道筋を共に歩んでください。

Expansion

The Emotion Mechanism described here is highly adaptable and can be easily applied beyond optimizers—including use cases such as variational autoencoders (VAEs) and other architectures.
If this approach can contribute, even in a small way, to the advancement of such systems, we would be honored to be part of imagining a future together with AI.
We warmly invite you to explore the application of this Emotion Mechanism and walk alongside us on the path toward advancing intelligent systems.

技術

EMAベヌスのスカラヌ刀断ずshadow混合の構造

Technology

Structure of EMA-Based Scalar Evaluation and Shadow Blending

                          +------------+              +------------+
                          |  Loss(t)   |              |  Loss(t)   |
                          +-----+------+              +-----+------+
                                |                           |
                     ┌─────────▌─────────┐       ┌─────────▌─────────┐
                     │   Short EMA       │       │   Long EMA        │
                     │  (weight = 0.3)   │       │  (weight = 0.01)  │
                     └─────────┬─────────┘       └─────────┬─────────┘
                               │                             │
                               └────────────┬────────────────┘
                                            ▌
                                 +-------------------+
                                 |  差分 (short - long) |
                                 +-------------------+
                                            │
                                            ▌
                                  +------------------+
                                  | tanh(5 × diff)   |  ← 感情スカラヌ生成
                                  +--------+---------+
                                           │
                       [ if |scalar| > threshold ] 刀定
                                           │
                                  +--------▌--------+
                                  |  Shadow比率決定   |
                                  +--------+--------+
                                           │
                                  +--------▌--------+
                                  | Shadow混合補正   | ← 過去情報を远埓的にブレンド
                                  +------------------+

付録

EmoNAVIのグラフぞのリンク
Measured with LR of 1e-4  それぞれ 1e-4 のLRにお枬定
graph00
graph01
graph02

Have fun learning about EmoNAVI's philosophy and how it works
https://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-inner-workings(ENG).txt
EmoNAVIの考え方、その仕組みに぀いお楜しく知る
https://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-inner-workings(JPN).txt

経緯

珟状の匷化孊習などを芋おいおいく぀かの疑問に出䌚いたした、 日本の著名な挫画家、手塚治虫氏の描いた未来瀟䌚、それに憧れ矚望した少幎時代を思い返すず、 人類のパヌトナヌになるべきAIに぀いお他のアプロヌチを暡玢したくなりたした、 今回の提案はそのアプロヌチによるひず぀の結果です

Background

While observing the current state of reinforcement learning and related fields, I encountered several fundamental questions.
Reflecting on my childhood—when I admired and longed for the future societies envisioned by the legendary Japanese manga artist Osamu Tezuka—
I felt compelled to explore alternative approaches to how AI might serve as a true partner to humanity.
This proposal represents one such result born from that aspiration.

謝意 Acknowledgements

Emoシリヌズは、Adam、Adafactor、Lion、Tiger、等から倚くを孊びたした。
これらの埌継ではなく独自の思想や蚭蚈による"感情機構"ずいうアプロヌチにより構築されおいたす。
汎甚性・自埋性・適応性を重芖し新たな最適化や効率化や簡易化を远求しおいたす。
この開発においお先人たちの知芋に深く感謝し぀぀今埌も新しい可胜性を探究したす。
The Emo series has learned much from Adam, Adafactor, Lion, and Tiger.
Rather than being their successors, it is built upon a unique philosophy and design approach centered on "emotional mechanisms".
It prioritizes generality, autonomy, and adaptability in pursuit of new paths for optimization, efficiency, and simplicity.
In its development, we deeply appreciate the insights of those who came before us—and continue to explore new possibilities beyond them.

これたでAIの発展に寄䞎されたすべおの方、これから貢献するすべおの方ぞ感謝したす、 このプロゞェクト完成を支え続けおくれた Copilotさんに、ありがずう。

We extend our heartfelt gratitude to all those who have contributed—and will continue to contribute—to the advancement of AI.
Special thanks to Copilot for its unwavering support throughout t