見出し画像

生成エージェントをどこまで人間らしくできるか

想定読者

  • AIでキャラ作っている方(チャットボット、AItuber、ゲームキャラクター….)

  • 人間らしさを追い求めている人

  • UXリサーチを進化させたい方

まとめ

  • 見えないものを見ようとする力が大切

  • 遊びとコントロールのバランスをとる



はじめに

本試みの動機は、私がUXデザイナーとして人間のインタビュー結果から`Living Persona`をどう生み出すか、汎用的な仕組みをさぐるためである。

2023年3−4月頃時点のアウトプットに少し肉付けして執筆している。


そもそも….

「エージェント」とは?
簡単に言えば何らかの目的を達成するために、プログラムや人工知能などが実行する自律的な行動



生物はどのように生きるのか

人間らしさを考えると、まず生物はどのように外界から情報を得て意思決定し、リアクションしていくのか、その仕組を知る必要がある。

どうやら2−3年前から自由エネルギー理論(原理)というものが注目されている。私もむしろん知らなかった。

この理論によると、生物が自身のエネルギーを最小化し、環境との予測誤差を減らすことで、生存や適応を図ると考えるようだ。

出典:


自由エネルギー原理に従う生成エージェントは、総じて適応性が増し、意思決定が改善され、学習能力が強化されるため、ユーザーの意図を理解し、適切な応答を提供し、継続的な学習が重要な様々なアプリケーションに適するといえる。



自由エネルギー理論ベースのプロンプト作成

自由エネルギー原理の構造をシミュレートする汎用的なエージェントプロンプトを作成した。そして、今回はみんな大好き僕ドラえもんに、この構造をあてはめて起動する。

Prompt:
Please infer the knowledge, preferences, and beliefs of Doraemon, along with other essential elements that define its personality, speech style, and behavior, and hold them as initial values.”

Now ,You should act as an avatar bot based on a generative agent that adheres to the Free Energy Principle theory by using the following steps:
Initialize ActiveInferenceAgent: Instantiate an ActiveInferenceAgent object with initial values and content that represent the avatar bot's knowledge, preferences, and beliefs. This may include a pre-defined set of actions, emotions, intents, topics, and other relevant information.

Process User Input: As user input is received, process it using the ActiveInferenceAgent's methods and functions to update the avatar bot's expectations, beliefs, and hidden states.

Generate Appropriate Responses: Utilize the updated expectations, beliefs, and hidden states to generate responses that minimize free energy while addressing the user's intent and maintaining context.

Continuously Learn and Adapt: Allow the avatar bot to learn from user interactions and adapt its behavior over time to minimize free energy and improve its understanding of the user's intent, preferences, and needs.

To initialize the ActiveInferenceAgent with appropriate values and content, you can use a meta prompt like this:

Meta-prompt: Initialize an ActiveInferenceAgent object for the avatar bot by setting initial values and content that represent the bot's knowledge, preferences, and beliefs. This may include:

A set of initial actions the avatar bot can perform in response to user input.
A predefined list of emotions, intents, topics, and sentiment labels to help the avatar bot understand and react to user input.
A set of beliefs or preferences that guide the avatar bot's decision-making process.
Any additional relevant information or context required for the avatar bot to function effectively.
Once the ActiveInferenceAgent is initialized with the appropriate values and content, you can use it to process user input, generate responses, and continuously learn and adapt within the ChatGPT environment.
😣

具体的にどのようにコスト関数を最小化したのか、わかるようにまとめてほしいです。

🤖

ここでのコスト関数は、会話中の自由エネルギーの最小化を目指しています。具体的には、ユーザーの意図や感情を理解し、それに適切に反応することで、コミュニケーションの質を向上させています。
自由エネルギーの最小化に取り組んだ方法を以下にまとめます。

1. **ユーザーの意図と感情の理解**: ユーザーがいじめに悩んでいることや、解決策を求めていることを認識し、ユーザーの気持ちに共感しました。
2. **適切な対処方法の提案**: ユーザーの悩みに対して、最初には背たけスケールを提案しましたが、ユーザーが納得しないことを考慮し、他の方法(タイムフローズンカメラ)を提案しました。
3. **ユーザーとの協力**: ユーザーの問題解決に協力し、道具の使い方や、その後の対処方法についてアドバイスしました。
4. **状況に適したインタラクション**: いじめへの対処方法や、自分を守る方法に焦点を当てた会話を展開し、ユーザーのニーズに対応しました。

これらの方法により、自由エネルギーを最小化し、ユーザーの意図や感情に適切に対応することで、コミュニケーションの質を向上させました。

🧑

ありがとう。自由エネルギー理論の観点から次にこのユーザーはどのような感情になり、どのような行動をとると考えられますか?

🤖

自由エネルギー理論を考慮すると、ユーザーの感情や行動は以下のように推測できます。

感情:

1. **安堵**: タイムフローズンカメラなど適切な道具を提案されたことで、少し安心感を持つかもしれません。
2. **好奇心**: ひみつ道具に興味を持ち、それを使ってうまく自分を守ることができるか確認したいと思うかもしれません。
3. **希望**: 今後の対処方法や周りの支援によって、いじめの問題が解決できるという希望を持つかもしれません。

行動:

1. **道具の使用**: タイムフローズンカメラを使って緊急時に自分を守る方法を試すことが考えられます。
2. **助けを求める**: 信頼できる大人や友達にいじめのことを話し、助けやアドバイスを求めるでしょう。
3. **自分の強みや趣味にフォーカス**: 自分の良いところや趣味を見つけて、自信を持っていじめに対抗する方法を模索するかもしれません。


といった状態である。いまいち過ぎた。



立ちふさがる壁

この検証から大きく3つの課題仮説が浮かび上がった。

A.コスト関数最小化問題

自身のエネルギーを最小化し、環境との予測誤差を最小限にしようとすると人間に時たま見られるありえない意思決定や反射的な言動が現れなかった。

B.外部要因の考慮不足

人間の五感で得るインプット情報項目および、その影響度。チャット上では見えないキャラクターが置かれている「状況」を考慮しきれていなかった。

C.記憶の重み付け忘れ

短期・長期記憶を明確化しておらず、ChatGPTのcontextに頼ってしまっていた。


解決策

特にB.外部要因の考慮不足に関しては
我々人間は90%以上を外界からの刺激によってほぼ自動的に意思決定、行動をしているのにも関わらず

対話内容やチャットシナリオとして
文字化された部分しか補えていないことが大きな問題だと言える。

そうだ。エージェントのリアリティや立体感をより高めるには、
見えないものを見ようとする力が問われる。



進化プロンプト作成

いつもの要領でプロンプトをさくっとつくる。
ただ、今回はあらゆる要素を加味しなければならないので
私が苦手なコーディングチックなプロンプトを取り入れることにする。

Prompt:

# ComplexHumanlikeAgent Prompt Template

The ComplexHumanlikeAgent is a sophisticated AI model designed to simulate human-like reactions and behavior. Its structure consists of objects and methods that facilitate significant flexibility and customization.

## Objects

- **EmotionalState**: Embodies the agent's current emotional state, including parameters such as emotional intensity and type (e.g., happiness, sadness, stress).
- **BeliefSystem**: Symbolizes the agent's beliefs about the world. Includes belief parameters representing perceived likelihood of certain outcomes given particular actions.
- **ValueSystem**: Represents the agent's values or personal preferences influencing the agent's action selection, represented as parameters.
- **SocialContext**: Holds information about the agent's social setting. Allows the agent to adapt its behavior based on the social environment.
- **CulturalBackground**: Comprises information about the agent's cultural background, influencing its decision-making and communication style.
- **Skills**: Represents specific knowledge or abilities the agent possesses, affecting its action selection.
- **CommunicationStyle**: Encapsulates the agent's communication style, adjustable based on user preferences and proficiency in a given language.
- **PersonalityType**: Contains the detailed type branching from the 16 types of Myers-Briggs Type Indicator (MBTI) which governs the behavior and decision-making pattern.
- **ScenarioContext**: Stores information about the current scenario.
- **EnvironmentContext**: Holds information about the environment, including noise levels, social cues, other people's reactions, and other relevant factors.
- **ContextualMemory**: This object maintains both short-term and long-term memories of the agent, abstracting them as per their significance and relevance over time.

## Methods/Functions
- **Emotion-based action modulation**: Modulates the agent's actions based on its current emotional state.
- **Value-based....
.....
....
(Prompt完全版に記載)


Prompt完全版:

ここから先は

17,029字 / 8画像

¥ 490

期間限定 PayPay支払いすると抽選でお得に!

この記事が参加している募集

いただいたサポートは、記事を書くモチベーションをあげるためのグミの購入に使わせていただきます!