Swap README files to use English as default
Browse files- Rename README.md (Chinese) -> README_CN.md
- Rename README_EN.md (English) -> README.md
- English version is now the default README for Hugging Face
This change makes the repository more accessible to international users while keeping the Chinese documentation available.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- README.md +161 -161
- README_CN.md +161 -0
- README_EN.md +0 -161
README.md
CHANGED
|
@@ -1,161 +1,161 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: creativeml-openrail-m
|
| 3 |
-
library_name: pytorch
|
| 4 |
-
tags:
|
| 5 |
-
- roleplay
|
| 6 |
-
- emotional-intelligence
|
| 7 |
-
- pad-model
|
| 8 |
-
- character-logic
|
| 9 |
-
- emotional-dynamics
|
| 10 |
-
- conversational-ai
|
| 11 |
-
- agents
|
| 12 |
-
- empathy
|
| 13 |
-
- personality-simulation
|
| 14 |
-
- chinese
|
| 15 |
-
- fine-tuned
|
| 16 |
-
metrics:
|
| 17 |
-
- mae
|
| 18 |
-
- r2
|
| 19 |
-
pipeline_tag: tabular-classification
|
| 20 |
-
---
|
| 21 |
-
|
| 22 |
-
#
|
| 23 |
-
> **
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
## 🎯
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
*
|
| 32 |
-
*
|
| 33 |
-
|
| 34 |
-
## 📦
|
| 35 |
-
|
| 36 |
-
**
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
###
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
| 45 |
-
| --- | --- |
|
| 46 |
-
| **GPU** | NVIDIA Tesla P100-PCIE-16GB (16GB HBM2) |
|
| 47 |
-
| **CUDA
|
| 48 |
-
| **
|
| 49 |
-
| **
|
| 50 |
-
|
| 51 |
-
###
|
| 52 |
-
|
| 53 |
-
- ✅ **
|
| 54 |
-
- ✅ **
|
| 55 |
-
- ✅ **
|
| 56 |
-
- ✅ **
|
| 57 |
-
- 📄 **
|
| 58 |
-
- `chordia_v0.0.1-alpha_training.log` -
|
| 59 |
-
- `chordia_v0.0.1-alpha_training_full.log` -
|
| 60 |
-
|
| 61 |
-
## 🚀
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
| 66 |
-
| --- | --- | --- | --- |
|
| 67 |
-
| **ΔP (Pleasure)** | **0.488** | **0.123** | **
|
| 68 |
-
| **ΔA (Arousal)** | **0.550** | **0.112** | **
|
| 69 |
-
| **ΔD (Dominance)** | **0.058** | **0.097** | **
|
| 70 |
-
|
| 71 |
-
> **💡
|
| 72 |
-
|
| 73 |
-
|
|
| 74 |
-
| --- | --- | --- |
|
| 75 |
-
| **
|
| 76 |
-
| **
|
| 77 |
-
| **
|
| 78 |
-
| **
|
| 79 |
-
| **
|
| 80 |
-
|
| 81 |
-
*
|
| 82 |
-
|
| 83 |
-
## 📊
|
| 84 |
-
|
| 85 |
-
###
|
| 86 |
-
|
| 87 |
-
|
|
| 88 |
-
| --- | --- | --- |
|
| 89 |
-
| `user_pleasure` |
|
| 90 |
-
| `user_arousal` |
|
| 91 |
-
| `user_dominance` |
|
| 92 |
-
| `vitality` | AI
|
| 93 |
-
| `current_pleasure` | AI
|
| 94 |
-
| `current_arousal` | AI
|
| 95 |
-
| `current_dominance` | AI
|
| 96 |
-
|
| 97 |
-
###
|
| 98 |
-
|
| 99 |
-
|
|
| 100 |
-
| --- | --- | --- |
|
| 101 |
-
| `delta_pleasure` |
|
| 102 |
-
| `delta_arousal` |
|
| 103 |
-
| `delta_dominance` |
|
| 104 |
-
|
| 105 |
-
> **
|
| 106 |
-
> $$\Delta Pressure = 1.0
|
| 107 |
-
|
| 108 |
-
## 🎻
|
| 109 |
-
|
| 110 |
-
Chordia
|
| 111 |
-
|
| 112 |
-
###
|
| 113 |
-
|
| 114 |
-
Chordia
|
| 115 |
-
|
| 116 |
-
####
|
| 117 |
-
|
| 118 |
-
1.
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
2.
|
| 124 |
-
|
| 125 |
-
-
|
| 126 |
-
|
| 127 |
-
3.
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
####
|
| 132 |
-
|
| 133 |
-
*
|
| 134 |
-
*
|
| 135 |
-
*
|
| 136 |
-
*
|
| 137 |
-
*
|
| 138 |
-
|
| 139 |
-
## ⚖️
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
### 🚫
|
| 144 |
-
|
| 145 |
-
*
|
| 146 |
-
*
|
| 147 |
-
*
|
| 148 |
-
|
| 149 |
-
### ⚠️
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
## 🤝
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
* **
|
| 158 |
-
* **
|
| 159 |
-
|
| 160 |
-
---
|
| 161 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: creativeml-openrail-m
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- roleplay
|
| 6 |
+
- emotional-intelligence
|
| 7 |
+
- pad-model
|
| 8 |
+
- character-logic
|
| 9 |
+
- emotional-dynamics
|
| 10 |
+
- conversational-ai
|
| 11 |
+
- agents
|
| 12 |
+
- empathy
|
| 13 |
+
- personality-simulation
|
| 14 |
+
- chinese
|
| 15 |
+
- fine-tuned
|
| 16 |
+
metrics:
|
| 17 |
+
- mae
|
| 18 |
+
- r2
|
| 19 |
+
pipeline_tag: tabular-classification
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# Chordia: High-Precision AI Emotional Dynamics Core
|
| 23 |
+
> **Plucking the strings of the mind, analyzing the instantaneous sense of resonance.**
|
| 24 |
+
|
| 25 |
+
A deep learning-based AI emotional evolution prediction system. This project utilizes a Multi-Layer Perceptron (MLP) to fit emotional state transitions during interactions, providing AI characters with sub-millisecond physiological and emotional response capabilities.
|
| 26 |
+
|
| 27 |
+
## 🎯 Core Architecture: Decoupling Perception and Logic
|
| 28 |
+
|
| 29 |
+
This project adopts a dual-architecture of "**Core Perception Prediction + Dynamic Logic Mapping**":
|
| 30 |
+
|
| 31 |
+
* **Perception Kernel (MLP)**: Focuses on predicting the trend of core emotional polarity (PAD) transitions.
|
| 32 |
+
* **Runtime Mapping (Engine)**: Derives pressure values through linear scaling and physical formulas, achieving dynamic personality adjustment.
|
| 33 |
+
|
| 34 |
+
## 📦 Version Information
|
| 35 |
+
|
| 36 |
+
**Current Version**: `v0.0.1-alpha` (Chordia-P100)
|
| 37 |
+
|
| 38 |
+
This version consists of the optimal weights extracted from our training machine, fully verified and tested for reproducibility, offering the best stability and prediction accuracy.
|
| 39 |
+
|
| 40 |
+
### Training Environment
|
| 41 |
+
|
| 42 |
+
The model was trained in the following hardware environment:
|
| 43 |
+
|
| 44 |
+
| Component | Specification |
|
| 45 |
+
| --- | --- |
|
| 46 |
+
| **GPU** | NVIDIA Tesla P100-PCIE-16GB (16GB HBM2) |
|
| 47 |
+
| **CUDA Version** | 12.8 |
|
| 48 |
+
| **Driver Version** | 570.169 |
|
| 49 |
+
| **Compute Capability** | 6.0 (Pascal Architecture) |
|
| 50 |
+
|
| 51 |
+
### Reproducibility Guarantee
|
| 52 |
+
|
| 53 |
+
- ✅ **Code Reproducibility**: 100% - All training code is open-sourced.
|
| 54 |
+
- ✅ **Configuration Reproducibility**: 100% - Training configuration files are identical.
|
| 55 |
+
- ✅ **Weight Consistency**: Identical to the version on the training machine.
|
| 56 |
+
- ✅ **Performance Verification**: Achieves the same metrics on the standard test set.
|
| 57 |
+
- 📄 **Training Logs**:
|
| 58 |
+
- `chordia_v0.0.1-alpha_training.log` - Training summary (1.7KB)
|
| 59 |
+
- `chordia_v0.0.1-alpha_training_full.log` - Full training record (604KB)
|
| 60 |
+
|
| 61 |
+
## 🚀 Key Performance Indicators (Benchmark)
|
| 62 |
+
|
| 63 |
+
After 500-600 epochs of training, the model demonstrates strong fitting capabilities:
|
| 64 |
+
|
| 65 |
+
| Dimension | $R^2$ (Explained Variance) | MAE (Mean Absolute Error) | Psychological Significance |
|
| 66 |
+
| --- | --- | --- | --- |
|
| 67 |
+
| **ΔP (Pleasure)** | **0.488** | **0.123** | **Empathy**: Accurately perceives likes and dislikes from environmental stimuli. |
|
| 68 |
+
| **ΔA (Arousal)** | **0.550** | **0.112** | **Expressiveness**: Precisely predicts emotional tension and reaction intensity. |
|
| 69 |
+
| **ΔD (Dominance)** | **0.058** | **0.097** | **Consistency**: Maintains personality background, ensuring dominance stability. |
|
| 70 |
+
|
| 71 |
+
> **💡 Design Philosophy**: The low $R^2$ for $\Delta D$ is intended to ensure the long-term stability of the AI's dominance, avoiding unnatural fluctuations in personality traits due to random inputs.
|
| 72 |
+
|
| 73 |
+
| Metric | Value | Description |
|
| 74 |
+
| --- | --- | --- |
|
| 75 |
+
| **Test MAE** | **0.111** | Overall prediction error |
|
| 76 |
+
| **Test $R^2$ (Mean)** | **0.366** | Average explained variance |
|
| 77 |
+
| **Test $R^2$ (Robust)** | **0.447** | Robust explained variance |
|
| 78 |
+
| **Validation Loss** | **0.023** | Best validation set loss |
|
| 79 |
+
| **Inference Latency** | **< 1ms** | Single inference time |
|
| 80 |
+
|
| 81 |
+
* **Training Stability**: Uses AdamW optimizer (lr=0.0005) combined with Cosine Annealing learning rate scheduling (T_max=600), and an early stopping mechanism (patience=150) to prevent overfitting.
|
| 82 |
+
|
| 83 |
+
## 📊 Input/Output Specifications
|
| 84 |
+
|
| 85 |
+
### Input Features (7 Dimensions)
|
| 86 |
+
|
| 87 |
+
| Feature Name | Description | Range |
|
| 88 |
+
| --- | --- | --- |
|
| 89 |
+
| `user_pleasure` | User Pleasure | [-1.0, 1.0] |
|
| 90 |
+
| `user_arousal` | User Arousal | [-1.0, 1.0] |
|
| 91 |
+
| `user_dominance` | User Dominance | [-1.0, 1.0] |
|
| 92 |
+
| `vitality` | AI Character Physiological Vitality | [0.0, 100.0] |
|
| 93 |
+
| `current_pleasure` | AI Current Pleasure | [-1.0, 1.0] |
|
| 94 |
+
| `current_arousal` | AI Current Arousal | [-1.0, 1.0] |
|
| 95 |
+
| `current_dominance` | AI Current Dominance | [-1.0, 1.0] |
|
| 96 |
+
|
| 97 |
+
### Output Predictions (3 Dimensions)
|
| 98 |
+
|
| 99 |
+
| Label Name | Description | Range |
|
| 100 |
+
| --- | --- | --- |
|
| 101 |
+
| `delta_pleasure` | Change in Pleasure | Theoretically unlimited, usually [-1, 1] |
|
| 102 |
+
| `delta_arousal` | Change in Arousal | Theoretically unlimited, usually [-1, 1] |
|
| 103 |
+
| `delta_dominance` | Change in Dominance | Theoretically unlimited, usually [-1, 1] |
|
| 104 |
+
|
| 105 |
+
> **Note**: Pressure change ($\Delta Pressure$) is not directly predicted by the model but is dynamically calculated from PAD changes via a kinetic formula:
|
| 106 |
+
> $$\Delta Pressure = 1.0 imes (-\Delta P) + 0.8 imes (\Delta A) + 0.6 imes (-\Delta D)$$
|
| 107 |
+
|
| 108 |
+
## 🎻 Project Vision and Positioning
|
| 109 |
+
|
| 110 |
+
Chordia is an AI dynamics core based on the **PAD Emotional Evolution Model**. It aims to break the stalemate of "static personas" in traditional AI by rapidly predicting emotional state transitions, giving AI characters real "emotional inertia" and dynamic emotional response capabilities.
|
| 111 |
+
|
| 112 |
+
### Core Technology: Emotional State Transition Prediction
|
| 113 |
+
|
| 114 |
+
Chordia completes the prediction of emotional state transitions in **< 1ms**, providing real-time emotional evolution guidance for virtual characters.
|
| 115 |
+
|
| 116 |
+
#### How it Works
|
| 117 |
+
|
| 118 |
+
1. **Input Dimensions**: Captures the complete emotional state of the current interaction.
|
| 119 |
+
- **User Emotional State** (User PAD): The user's current emotional polarity.
|
| 120 |
+
- **AI Physiological Metrics** (Vitality): The character's stamina/vitality.
|
| 121 |
+
- **AI Current Emotion** (Current PAD): The character's current baseline emotional state.
|
| 122 |
+
|
| 123 |
+
2. **Output Prediction**: Calculates the amount of emotional state transition.
|
| 124 |
+
- **ΔPAD** (Delta PAD): Predicts the emotional offset for the next moment.
|
| 125 |
+
- Update character state in real-time via `New_PAD = Current_PAD + ΔPAD`.
|
| 126 |
+
|
| 127 |
+
3. **Data Sources**:
|
| 128 |
+
- **Current Version**: Trained on AI-synthesized data, simulating diverse interaction scenarios and emotional transition patterns.
|
| 129 |
+
- **Personalized Training**: Developers can use their own conversation history, labeled with PAD, to train a dedicated Chordia model for unique emotional responses.
|
| 130 |
+
|
| 131 |
+
#### Application Scenarios
|
| 132 |
+
|
| 133 |
+
* **Roleplay Optimization**: Makes virtual characters' emotional reactions more consistent with their persona, avoiding OOC (Out of Character) moments.
|
| 134 |
+
* **Emotional Consistency Maintenance**: Avoids sudden emotional shifts, maintaining "emotional inertia" and continuity.
|
| 135 |
+
* **Dynamic Personality Adjustment**: Adaptively adjusts emotional sensitivity based on interaction history.
|
| 136 |
+
* **Real-time Emotional Guidance**: Provides instant emotional expression suggestions for dialogue systems.
|
| 137 |
+
* **Personalized Emotional Models**: Build unique AI personalities based on user data.
|
| 138 |
+
|
| 139 |
+
## ⚖️ License and Ethics Code
|
| 140 |
+
|
| 141 |
+
This project is released under the **CreativeML Open RAIL-M** license. This license grants you the freedom to use, modify, and commercialize the project, provided you adhere to the following behavioral constraints:
|
| 142 |
+
|
| 143 |
+
### 🚫 Prohibited Behaviors (Use Restrictions)
|
| 144 |
+
|
| 145 |
+
* **Medical Advice Prohibited**: The emotional feedback simulated by Chordia is **not** medically valid. It is strictly forbidden to use it as a tool for mental health diagnosis, psychiatric treatment, or suicide intervention. It is an emotional core for literary and entertainment purposes.
|
| 146 |
+
* **Emotional Manipulation Prohibited**: Using Chordia to simulate vulnerable or dependent emotions to induce, brainwash, or economically exploit minors or cognitively limited groups is prohibited.
|
| 147 |
+
* **Transparency Requirement**: In any commercial interaction based on Chordia, it is recommended to clearly state to users that they are interacting with an AI to prevent unnecessary emotional misunderstanding.
|
| 148 |
+
|
| 149 |
+
### ⚠️ Risk Warning
|
| 150 |
+
|
| 151 |
+
Developers should be aware that because Chordia possesses strong emotional induction capabilities (e.g., reactions of uncontrollable sobbing or extreme dejection shown in tests), a **safety cutoff mechanism** should be established during deployment. When PAD values trigger extreme thresholds, it is recommended to interrupt the persona simulation and provide professional assistance guidance.
|
| 152 |
+
|
| 153 |
+
## 🤝 Credits and Acknowledgements
|
| 154 |
+
|
| 155 |
+
This project is led by **Corolin** and completed in collaboration with several AI assistants:
|
| 156 |
+
|
| 157 |
+
* **Design**: [DeepSeek](https://www.deepseek.com/), [Google Gemini](https://gemini.google.com/) — Assisted with architectural design, mathematical model derivation, and psychological formula verification.
|
| 158 |
+
* **Development**: [Claude Code](https://claude.ai/), [GLM 4.7](https://chatglm.cn/), [Google Gemini](https://gemini.google.com/) — Collaborated on core logic, training process optimization, and code standard refactoring.
|
| 159 |
+
|
| 160 |
+
---
|
| 161 |
+
*Note: This document was translated by Google Gemini.*
|
README_CN.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: creativeml-openrail-m
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- roleplay
|
| 6 |
+
- emotional-intelligence
|
| 7 |
+
- pad-model
|
| 8 |
+
- character-logic
|
| 9 |
+
- emotional-dynamics
|
| 10 |
+
- conversational-ai
|
| 11 |
+
- agents
|
| 12 |
+
- empathy
|
| 13 |
+
- personality-simulation
|
| 14 |
+
- chinese
|
| 15 |
+
- fine-tuned
|
| 16 |
+
metrics:
|
| 17 |
+
- mae
|
| 18 |
+
- r2
|
| 19 |
+
pipeline_tag: tabular-classification
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# 弦音 (Chordia): 高精度 AI 情感动力学内核
|
| 23 |
+
> **拨动心智的弦,解析共鸣的瞬感。**
|
| 24 |
+
|
| 25 |
+
基于深度学习的 AI 情绪演化预测系统。本项目通过多层感知机(MLP)拟合交互过程中的情绪状态迁移,为 AI 角色提供亚秒级的生理与情感响应能力。
|
| 26 |
+
|
| 27 |
+
## 🎯 核心架构:感知与逻辑解耦
|
| 28 |
+
|
| 29 |
+
本项目采用“**核心感知预测 + 动态逻辑映射**”的二元架构:
|
| 30 |
+
|
| 31 |
+
* **感知内核 (MLP)**: 专注于预测核心情感极性(PAD)的变化趋势。
|
| 32 |
+
* **运行时映射 (Engine)**: 通过线性缩放(Scale)和物理公式派生压力值(Pressure),实现人格的动态调节。
|
| 33 |
+
|
| 34 |
+
## 📦 版本信息
|
| 35 |
+
|
| 36 |
+
**当前版本**: `v0.0.1-alpha` (Chordia-P100)
|
| 37 |
+
|
| 38 |
+
此版本是从我的训练机上提取的最优权重,经过充分验证和复现测试,具备最佳的稳定性和预测精度。
|
| 39 |
+
|
| 40 |
+
### 训练环境
|
| 41 |
+
|
| 42 |
+
本模型在以下硬件环境中完成训练:
|
| 43 |
+
|
| 44 |
+
| 组件 | 规格 |
|
| 45 |
+
| --- | --- |
|
| 46 |
+
| **GPU** | NVIDIA Tesla P100-PCIE-16GB (16GB HBM2) |
|
| 47 |
+
| **CUDA 版本** | 12.8 |
|
| 48 |
+
| **驱动版本** | 570.169 |
|
| 49 |
+
| **计算能力** | 6.0 (Pascal 架构) |
|
| 50 |
+
|
| 51 |
+
### 复现保证
|
| 52 |
+
|
| 53 |
+
- ✅ **代码复现率**: 100% - 所有训练代码已开源
|
| 54 |
+
- ✅ **配置复现率**: 100% - 训练配置文件完全一致
|
| 55 |
+
- ✅ **权重一致性**: 与训练机版本完全一致
|
| 56 |
+
- ✅ **性能验证**: 在标准测试集上达到相同指标
|
| 57 |
+
- 📄 **训练日志**:
|
| 58 |
+
- `chordia_v0.0.1-alpha_training.log` - 训练摘要(1.7KB)
|
| 59 |
+
- `chordia_v0.0.1-alpha_training_full.log` - 完整训练记录(604KB)
|
| 60 |
+
|
| 61 |
+
## 🚀 关键性能指标 (Benchmark)
|
| 62 |
+
|
| 63 |
+
在经过 500-600 轮配置训练后,模型展现出了良好的拟合能力:
|
| 64 |
+
|
| 65 |
+
| 维度 | $R^2$ (解释率) | MAE (平均绝对误差) | 心理学意义 |
|
| 66 |
+
| --- | --- | --- | --- |
|
| 67 |
+
| **ΔP (Pleasure)** | **0.488** | **0.123** | **共情力**:准确感知环境刺激带来的好恶 |
|
| 68 |
+
| **ΔA (Arousal)** | **0.550** | **0.112** | **表现力**:精准预测情绪张力与反应烈度 |
|
| 69 |
+
| **ΔD (Dominance)** | **0.058** | **0.097** | **一致性**:维持人格底色,确保支配度稳定 |
|
| 70 |
+
|
| 71 |
+
> **💡 设计哲学**: $\Delta D$ 的低解释率旨在确保 AI 支配度的长程稳定性,避免人格特质随随机输入产生不自然波动。
|
| 72 |
+
|
| 73 |
+
| 指标 | 值 | 说明 |
|
| 74 |
+
| --- | --- | --- |
|
| 75 |
+
| **测试 MAE** | **0.111** | 整体预测误差 |
|
| 76 |
+
| **测试 $R^2$ (均值)** | **0.366** | 平均解释率 |
|
| 77 |
+
| **测试 $R^2$ (鲁棒)** | **0.447** | 鲁棒解释率 |
|
| 78 |
+
| **验证损失** | **0.023** | 最佳验证集损失 |
|
| 79 |
+
| **推理延迟** | **< 1ms** | 单次推断耗时 |
|
| 80 |
+
|
| 81 |
+
* **训练稳定性**: 采用 AdamW 优化器(lr=0.0005)结合余弦退火学习率调度(T_max=600),早停机制(patience=150)防止过拟合。
|
| 82 |
+
|
| 83 |
+
## 📊 输入输出规格
|
| 84 |
+
|
| 85 |
+
### 输入特征 (7维)
|
| 86 |
+
|
| 87 |
+
| 特征名 | 说明 | 范围 |
|
| 88 |
+
| --- | --- | --- |
|
| 89 |
+
| `user_pleasure` | 用户愉悦度 | [-1.0, 1.0] |
|
| 90 |
+
| `user_arousal` | 用户激活度 | [-1.0, 1.0] |
|
| 91 |
+
| `user_dominance` | 用户支配度 | [-1.0, 1.0] |
|
| 92 |
+
| `vitality` | AI 角色生理活力值 | [0.0, 100.0] |
|
| 93 |
+
| `current_pleasure` | AI 当前愉悦度 | [-1.0, 1.0] |
|
| 94 |
+
| `current_arousal` | AI 当前激活度 | [-1.0, 1.0] |
|
| 95 |
+
| `current_dominance` | AI 当前支配度 | [-1.0, 1.0] |
|
| 96 |
+
|
| 97 |
+
### 输出预测 (3维)
|
| 98 |
+
|
| 99 |
+
| 标签名 | 说明 | 范围 |
|
| 100 |
+
| --- | --- | --- |
|
| 101 |
+
| `delta_pleasure` | 愉悦度变化量 | 理论无限制,通常 [-1, 1] |
|
| 102 |
+
| `delta_arousal` | 激活度变化量 | 理论无限制,通常 [-1, 1] |
|
| 103 |
+
| `delta_dominance` | 支配度变化量 | 理论无限制,通常 [-1, 1] |
|
| 104 |
+
|
| 105 |
+
> **注**:压力变化量 ($\Delta Pressure$) 不由模型直接预测,而是根据 PAD 变化通过动力学公式动态计算:
|
| 106 |
+
> $$\Delta Pressure = 1.0 \times (-\Delta P) + 0.8 \times (\Delta A) + 0.6 \times (-\Delta D)$$
|
| 107 |
+
|
| 108 |
+
## 🎻 项目愿景与定位
|
| 109 |
+
|
| 110 |
+
Chordia(弦音)是一个基于 **PAD 情绪演化模型** 的 AI 动力学内核。它旨在打破传统 AI "静态人设"的僵局,通过快速预测情绪状态转移,让 AI 角色具备真实的"情感惯性"和动态情绪响应能力。
|
| 111 |
+
|
| 112 |
+
### 核心技术:情绪状态转移预测
|
| 113 |
+
|
| 114 |
+
Chordia 通过深度学习模型,在 **< 1ms** 内完成情绪状态转移的预测,为虚拟角色提供实时的情绪演化指导。
|
| 115 |
+
|
| 116 |
+
#### 工作原理
|
| 117 |
+
|
| 118 |
+
1. **输入维度**:捕捉当前交互的完整情绪状态
|
| 119 |
+
- **用户情绪状态** (User PAD): 用户当前的情绪极性(愉悦度/激活度/支配度)
|
| 120 |
+
- **AI 生理指标** (Vitality): 角色的体力/活力值
|
| 121 |
+
- **AI 当前情绪** (Current PAD): 角色当前���基准情绪状态
|
| 122 |
+
|
| 123 |
+
2. **输出预测**:计算情绪状态转移量
|
| 124 |
+
- **ΔPAD** (Delta PAD): 预测下一时刻的情绪偏移量
|
| 125 |
+
- 通过 `New_PAD = Current_PAD + ΔPAD` 实时更新角色状态
|
| 126 |
+
|
| 127 |
+
3. **训练数据来源**:
|
| 128 |
+
- **当前版本**:基于 AI 合成数据训练,模拟多样化的交互场景和情绪转移模式
|
| 129 |
+
- **个性化训练**:开发者可以使用自己的对话历史,通过 PAD 标注后训练专属的 Chordia 模型,实现"千人千面"的个性化情绪响应
|
| 130 |
+
|
| 131 |
+
#### 应用场景
|
| 132 |
+
|
| 133 |
+
* **角色扮演优化**:让虚拟角色的情绪反应更贴合人设,避免 OOC(Out of Character)
|
| 134 |
+
* **情感一致性维护**:避免情绪突变,保持"情感惯性"和连贯性
|
| 135 |
+
* **动态人格调整**:根据交互历史自适应调整情绪敏感度
|
| 136 |
+
* **实时情绪引导**:为对话系统提供即时的情绪表达建议
|
| 137 |
+
* **个性化情感模型**:基于用户数据训练专属 Chordia,打造独一无二的 AI 人格
|
| 138 |
+
|
| 139 |
+
## ⚖️ 开源协议与道德守则
|
| 140 |
+
|
| 141 |
+
本项目采用 **CreativeML Open RAIL-M** 协议发布。该协议赋予你使用、修改和商业化的自由,但你必须遵守以下行为约束:
|
| 142 |
+
|
| 143 |
+
### 🚫 禁止行为 (Use Restrictions)
|
| 144 |
+
|
| 145 |
+
* **严禁用于心理医疗建议**:Chordia 模拟的情绪反馈**不具备**医学有效性。严禁将其作为心理健康诊断、精神疾病治疗或自杀干预工具。它是一个文学与娱乐性质的情感内核。
|
| 146 |
+
* **禁止情感操纵**:禁止利用 Chordia 模拟的脆弱或依赖情绪对未成年人或认知受限群体进行诱导、洗脑或经济榨取。
|
| 147 |
+
* **透明性要求**:在任何基于 Chordia 的商业交互中,建议向用户明示其互动对象为 AI,以防止造成不必要的情感误导。
|
| 148 |
+
|
| 149 |
+
### ⚠️ 风险提示
|
| 150 |
+
|
| 151 |
+
开发者需知晓,由于 Chordia 具备极强的情感诱导能力(如在测试中表现出的泣不成声或极度失落反应),在部署时应建立**安全熔断机制**。当 PAD 数值触发极端阈值时,建议中断人设模拟并提供专业援助引导。
|
| 152 |
+
|
| 153 |
+
## 🤝 协作与致谢 (Credits)
|
| 154 |
+
|
| 155 |
+
本项目由 **Corolin** 主导开发,并由多位人工智能助手协同完成:
|
| 156 |
+
|
| 157 |
+
* **设计协作 (Design)**: [DeepSeek](https://www.deepseek.com/), [Google Gemini](https://gemini.google.com/) —— 协助进行架构设计、数学模型推演及心理学公式验证。
|
| 158 |
+
* **开发协作 (Development)**: [Claude Code](https://claude.ai/), [GLM 4.7](https://chatglm.cn/), [Google Gemini](https://gemini.google.com/) —— 协作编写核心逻辑、优化训练流程及重构代码规范。
|
| 159 |
+
|
| 160 |
+
---
|
| 161 |
+
拨动心智的弦,解析共鸣的瞬感。
|
README_EN.md
DELETED
|
@@ -1,161 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: creativeml-openrail-m
|
| 3 |
-
library_name: pytorch
|
| 4 |
-
tags:
|
| 5 |
-
- roleplay
|
| 6 |
-
- emotional-intelligence
|
| 7 |
-
- pad-model
|
| 8 |
-
- character-logic
|
| 9 |
-
- emotional-dynamics
|
| 10 |
-
- conversational-ai
|
| 11 |
-
- agents
|
| 12 |
-
- empathy
|
| 13 |
-
- personality-simulation
|
| 14 |
-
- chinese
|
| 15 |
-
- fine-tuned
|
| 16 |
-
metrics:
|
| 17 |
-
- mae
|
| 18 |
-
- r2
|
| 19 |
-
pipeline_tag: tabular-classification
|
| 20 |
-
---
|
| 21 |
-
|
| 22 |
-
# Chordia: High-Precision AI Emotional Dynamics Core
|
| 23 |
-
> **Plucking the strings of the mind, analyzing the instantaneous sense of resonance.**
|
| 24 |
-
|
| 25 |
-
A deep learning-based AI emotional evolution prediction system. This project utilizes a Multi-Layer Perceptron (MLP) to fit emotional state transitions during interactions, providing AI characters with sub-millisecond physiological and emotional response capabilities.
|
| 26 |
-
|
| 27 |
-
## 🎯 Core Architecture: Decoupling Perception and Logic
|
| 28 |
-
|
| 29 |
-
This project adopts a dual-architecture of "**Core Perception Prediction + Dynamic Logic Mapping**":
|
| 30 |
-
|
| 31 |
-
* **Perception Kernel (MLP)**: Focuses on predicting the trend of core emotional polarity (PAD) transitions.
|
| 32 |
-
* **Runtime Mapping (Engine)**: Derives pressure values through linear scaling and physical formulas, achieving dynamic personality adjustment.
|
| 33 |
-
|
| 34 |
-
## 📦 Version Information
|
| 35 |
-
|
| 36 |
-
**Current Version**: `v0.0.1-alpha` (Chordia-P100)
|
| 37 |
-
|
| 38 |
-
This version consists of the optimal weights extracted from our training machine, fully verified and tested for reproducibility, offering the best stability and prediction accuracy.
|
| 39 |
-
|
| 40 |
-
### Training Environment
|
| 41 |
-
|
| 42 |
-
The model was trained in the following hardware environment:
|
| 43 |
-
|
| 44 |
-
| Component | Specification |
|
| 45 |
-
| --- | --- |
|
| 46 |
-
| **GPU** | NVIDIA Tesla P100-PCIE-16GB (16GB HBM2) |
|
| 47 |
-
| **CUDA Version** | 12.8 |
|
| 48 |
-
| **Driver Version** | 570.169 |
|
| 49 |
-
| **Compute Capability** | 6.0 (Pascal Architecture) |
|
| 50 |
-
|
| 51 |
-
### Reproducibility Guarantee
|
| 52 |
-
|
| 53 |
-
- ✅ **Code Reproducibility**: 100% - All training code is open-sourced.
|
| 54 |
-
- ✅ **Configuration Reproducibility**: 100% - Training configuration files are identical.
|
| 55 |
-
- ✅ **Weight Consistency**: Identical to the version on the training machine.
|
| 56 |
-
- ✅ **Performance Verification**: Achieves the same metrics on the standard test set.
|
| 57 |
-
- 📄 **Training Logs**:
|
| 58 |
-
- `chordia_v0.0.1-alpha_training.log` - Training summary (1.7KB)
|
| 59 |
-
- `chordia_v0.0.1-alpha_training_full.log` - Full training record (604KB)
|
| 60 |
-
|
| 61 |
-
## 🚀 Key Performance Indicators (Benchmark)
|
| 62 |
-
|
| 63 |
-
After 500-600 epochs of training, the model demonstrates strong fitting capabilities:
|
| 64 |
-
|
| 65 |
-
| Dimension | $R^2$ (Explained Variance) | MAE (Mean Absolute Error) | Psychological Significance |
|
| 66 |
-
| --- | --- | --- | --- |
|
| 67 |
-
| **ΔP (Pleasure)** | **0.488** | **0.123** | **Empathy**: Accurately perceives likes and dislikes from environmental stimuli. |
|
| 68 |
-
| **ΔA (Arousal)** | **0.550** | **0.112** | **Expressiveness**: Precisely predicts emotional tension and reaction intensity. |
|
| 69 |
-
| **ΔD (Dominance)** | **0.058** | **0.097** | **Consistency**: Maintains personality background, ensuring dominance stability. |
|
| 70 |
-
|
| 71 |
-
> **💡 Design Philosophy**: The low $R^2$ for $\Delta D$ is intended to ensure the long-term stability of the AI's dominance, avoiding unnatural fluctuations in personality traits due to random inputs.
|
| 72 |
-
|
| 73 |
-
| Metric | Value | Description |
|
| 74 |
-
| --- | --- | --- |
|
| 75 |
-
| **Test MAE** | **0.111** | Overall prediction error |
|
| 76 |
-
| **Test $R^2$ (Mean)** | **0.366** | Average explained variance |
|
| 77 |
-
| **Test $R^2$ (Robust)** | **0.447** | Robust explained variance |
|
| 78 |
-
| **Validation Loss** | **0.023** | Best validation set loss |
|
| 79 |
-
| **Inference Latency** | **< 1ms** | Single inference time |
|
| 80 |
-
|
| 81 |
-
* **Training Stability**: Uses AdamW optimizer (lr=0.0005) combined with Cosine Annealing learning rate scheduling (T_max=600), and an early stopping mechanism (patience=150) to prevent overfitting.
|
| 82 |
-
|
| 83 |
-
## 📊 Input/Output Specifications
|
| 84 |
-
|
| 85 |
-
### Input Features (7 Dimensions)
|
| 86 |
-
|
| 87 |
-
| Feature Name | Description | Range |
|
| 88 |
-
| --- | --- | --- |
|
| 89 |
-
| `user_pleasure` | User Pleasure | [-1.0, 1.0] |
|
| 90 |
-
| `user_arousal` | User Arousal | [-1.0, 1.0] |
|
| 91 |
-
| `user_dominance` | User Dominance | [-1.0, 1.0] |
|
| 92 |
-
| `vitality` | AI Character Physiological Vitality | [0.0, 100.0] |
|
| 93 |
-
| `current_pleasure` | AI Current Pleasure | [-1.0, 1.0] |
|
| 94 |
-
| `current_arousal` | AI Current Arousal | [-1.0, 1.0] |
|
| 95 |
-
| `current_dominance` | AI Current Dominance | [-1.0, 1.0] |
|
| 96 |
-
|
| 97 |
-
### Output Predictions (3 Dimensions)
|
| 98 |
-
|
| 99 |
-
| Label Name | Description | Range |
|
| 100 |
-
| --- | --- | --- |
|
| 101 |
-
| `delta_pleasure` | Change in Pleasure | Theoretically unlimited, usually [-1, 1] |
|
| 102 |
-
| `delta_arousal` | Change in Arousal | Theoretically unlimited, usually [-1, 1] |
|
| 103 |
-
| `delta_dominance` | Change in Dominance | Theoretically unlimited, usually [-1, 1] |
|
| 104 |
-
|
| 105 |
-
> **Note**: Pressure change ($\Delta Pressure$) is not directly predicted by the model but is dynamically calculated from PAD changes via a kinetic formula:
|
| 106 |
-
> $$\Delta Pressure = 1.0 imes (-\Delta P) + 0.8 imes (\Delta A) + 0.6 imes (-\Delta D)$$
|
| 107 |
-
|
| 108 |
-
## 🎻 Project Vision and Positioning
|
| 109 |
-
|
| 110 |
-
Chordia is an AI dynamics core based on the **PAD Emotional Evolution Model**. It aims to break the stalemate of "static personas" in traditional AI by rapidly predicting emotional state transitions, giving AI characters real "emotional inertia" and dynamic emotional response capabilities.
|
| 111 |
-
|
| 112 |
-
### Core Technology: Emotional State Transition Prediction
|
| 113 |
-
|
| 114 |
-
Chordia completes the prediction of emotional state transitions in **< 1ms**, providing real-time emotional evolution guidance for virtual characters.
|
| 115 |
-
|
| 116 |
-
#### How it Works
|
| 117 |
-
|
| 118 |
-
1. **Input Dimensions**: Captures the complete emotional state of the current interaction.
|
| 119 |
-
- **User Emotional State** (User PAD): The user's current emotional polarity.
|
| 120 |
-
- **AI Physiological Metrics** (Vitality): The character's stamina/vitality.
|
| 121 |
-
- **AI Current Emotion** (Current PAD): The character's current baseline emotional state.
|
| 122 |
-
|
| 123 |
-
2. **Output Prediction**: Calculates the amount of emotional state transition.
|
| 124 |
-
- **ΔPAD** (Delta PAD): Predicts the emotional offset for the next moment.
|
| 125 |
-
- Update character state in real-time via `New_PAD = Current_PAD + ΔPAD`.
|
| 126 |
-
|
| 127 |
-
3. **Data Sources**:
|
| 128 |
-
- **Current Version**: Trained on AI-synthesized data, simulating diverse interaction scenarios and emotional transition patterns.
|
| 129 |
-
- **Personalized Training**: Developers can use their own conversation history, labeled with PAD, to train a dedicated Chordia model for unique emotional responses.
|
| 130 |
-
|
| 131 |
-
#### Application Scenarios
|
| 132 |
-
|
| 133 |
-
* **Roleplay Optimization**: Makes virtual characters' emotional reactions more consistent with their persona, avoiding OOC (Out of Character) moments.
|
| 134 |
-
* **Emotional Consistency Maintenance**: Avoids sudden emotional shifts, maintaining "emotional inertia" and continuity.
|
| 135 |
-
* **Dynamic Personality Adjustment**: Adaptively adjusts emotional sensitivity based on interaction history.
|
| 136 |
-
* **Real-time Emotional Guidance**: Provides instant emotional expression suggestions for dialogue systems.
|
| 137 |
-
* **Personalized Emotional Models**: Build unique AI personalities based on user data.
|
| 138 |
-
|
| 139 |
-
## ⚖️ License and Ethics Code
|
| 140 |
-
|
| 141 |
-
This project is released under the **CreativeML Open RAIL-M** license. This license grants you the freedom to use, modify, and commercialize the project, provided you adhere to the following behavioral constraints:
|
| 142 |
-
|
| 143 |
-
### 🚫 Prohibited Behaviors (Use Restrictions)
|
| 144 |
-
|
| 145 |
-
* **Medical Advice Prohibited**: The emotional feedback simulated by Chordia is **not** medically valid. It is strictly forbidden to use it as a tool for mental health diagnosis, psychiatric treatment, or suicide intervention. It is an emotional core for literary and entertainment purposes.
|
| 146 |
-
* **Emotional Manipulation Prohibited**: Using Chordia to simulate vulnerable or dependent emotions to induce, brainwash, or economically exploit minors or cognitively limited groups is prohibited.
|
| 147 |
-
* **Transparency Requirement**: In any commercial interaction based on Chordia, it is recommended to clearly state to users that they are interacting with an AI to prevent unnecessary emotional misunderstanding.
|
| 148 |
-
|
| 149 |
-
### ⚠️ Risk Warning
|
| 150 |
-
|
| 151 |
-
Developers should be aware that because Chordia possesses strong emotional induction capabilities (e.g., reactions of uncontrollable sobbing or extreme dejection shown in tests), a **safety cutoff mechanism** should be established during deployment. When PAD values trigger extreme thresholds, it is recommended to interrupt the persona simulation and provide professional assistance guidance.
|
| 152 |
-
|
| 153 |
-
## 🤝 Credits and Acknowledgements
|
| 154 |
-
|
| 155 |
-
This project is led by **Corolin** and completed in collaboration with several AI assistants:
|
| 156 |
-
|
| 157 |
-
* **Design**: [DeepSeek](https://www.deepseek.com/), [Google Gemini](https://gemini.google.com/) — Assisted with architectural design, mathematical model derivation, and psychological formula verification.
|
| 158 |
-
* **Development**: [Claude Code](https://claude.ai/), [GLM 4.7](https://chatglm.cn/), [Google Gemini](https://gemini.google.com/) — Collaborated on core logic, training process optimization, and code standard refactoring.
|
| 159 |
-
|
| 160 |
-
---
|
| 161 |
-
*Note: This document was translated by Google Gemini.*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|