🎃

OpenAI o1のオープンソースモデル?

2024/09/24に公開

Llamaberry

  • Llamaberryの提案者はMartin Bowlingでした。彼が開発したプロジェクトにはRAGMinerが含まれていました。dev および Replit。前者は、ユーザが RAG アプリケーションおよび LLM アプリケーションで使用する Markdown、XML、または JSON などの形式に簡単に変換できるようにします。後者は、AI を使用してアイデアをコード化するプロジェクトです。
  • Llamaberryの中核的な考え方は、推論のために思考連鎖(CoT)を使用することです。名前は自然とo1モデルを表すストロベリーに由来します。
  • HuggingFace地址

Llamaberryは、人間の専門家が難題を解決したときのように、AIに徹底的な思考を教えることができます。

具体的には、Llamaberry は、Groq で実行される Llama 3.170B モデルに基づく複数ラウンドのマインドチェーン推論システムの実装です。

多重推論

  • マルチラウンド推論は、文字通り、モデルが一歩ずつではなく、答えを出す前にマルチステップ思考をするようにすることです。例えば、これはシェフが料理の準備から完成まで一つ一つの素敵な料理を完成するのを見るようなもので、直接電子レンジで料理を加熱するのではありません。

    前のラウンドの出力が後のラウンドの入力になることがわかります。これにより、各フェーズで AI の思考が向上します。最後に、これらすべての思考は合理的な最終的な答えに凝縮されます。

実現

設定

最初に、AI Assistant の基本規則を次のように設定します。

initial_system_prompt = """You are an AI assistant capable of detailed, step-by-step thinking. When presented with a question or problem, break down your thought process into clear, logical steps. For each step, explain your reasoning. Conclude with a final answer. Use the following markdown structure:

## Reasoning
1. [First step]
   **Explanation:** [Detailed explanation of this step]
2. [Second step]
   **Explanation:** [Detailed explanation of this step]
...

## Answer
[Final answer]

Be comprehensive and show your reasoning clearly."""

これでAI は、思考プロセスを段階的に分解して各ステップを解釈し、Markdown 形式で表示する必要があることを認識しています。

思考過程

各推論では、AIが問題について考える必要があります。しかし、1ラウンドが終わった後は、すでに考えていたことを考えてみなければなりません。友人に聞くようなものです「ねえ、さっき言ったこと覚えてる?」もう一度考えてみましょう。」

各ラウンドの生成方法を次に示します。

async def generate_turn(query: str, previous_turns: list = None) -> str:
    is_first_turn = previous_turns is None or len(previous_turns) == 0
if is_first_turn:
        messages = [{
            "role": "system",
            "content": initial_system_prompt
        }, {
            "role": "user",
            "content": query
        }]
    else:
        previous_content = "\n\n".join(previous_turns)
        messages = [{
            "role": "system",
            "content": followup_system_prompt
        }, {
            "role":
            "user",
            "content":
            f"Original Query: {query}\n\nPrevious Turns:\n{previous_content}\n\nProvide the next turn of reasoning."
        }]

    return await call_llm(messages)

この関数は多輪推論の中心です。最初のラウンドか次のラウンドかを決定し、プロンプトを作成します。後続のホイールでは、以前のすべての推論ホイールがコンテキストに含まれ、AI が以前の思考に基づいて構築できるようになります。

統合結果

3 回の熟考の後、AI にすべての熟考を確認させ、合理的な最終的な回答を得るようにします。専門家が問題を討論して最終報告書を書くようにするのと同じです。

async def synthesize_turns(query: str, turns: list) -> str:
    turns_text = "\n\n".join(
        [f"Turn {i+1}:\n{turn}" for i, turn in enumerate(turns)])
    messages = [{
        "role": "system",
        "content": synthesis_prompt
    }, {
        "role":
        "user",
        "content":
        f"Original Query: {query}\n\nTurns of Reasoning:\n{turns_text}"
    }]
    return await call_llm(messages)

この総合的なステップは非常に重要であり、AIがすべての思考を統合して最終的な答えを作成するステップです。

単輪推論vs多重推論

マーティンボウリングはブログで単輪と複輪の推論を簡単に比較しました。

ここでは簡単な例として、AIに質問しました。「人工知能が雇用市場に与える潜在的な影響は何ですか?」

単輪推論:

AI: Artificial intelligence will likely have significant impacts on the job market, including:
1. Automation of routine tasks
2. Creation of new job roles in AI development and maintenance
3. Potential job displacement in certain industries
4. Increased demand for skills in data analysis and machine learning

While AI may eliminate some jobs, it will also create new opportunities and increase productivity in many fields.

Llamaberry を使用して複数ラウンドの推論:
第一ラウンド:

AI: Let's approach this step-by-step:

1. Identify current AI capabilities
   Explanation: AI can perform data analysis, pattern recognition, and automate routine tasks.

2. Analyze vulnerable job sectors
   Explanation: Manufacturing, customer service, and data entry are likely to be affected.

3. Consider new job opportunities
   Explanation: AI development, data science, and AI ethics consultation may see growth.

4. Examine potential economic effects
   Explanation: Increased productivity might lead to economic growth, but wealth distribution could be a challenge.

Initial Answer: AI will likely cause significant shifts in the job market, with both job losses in some sectors and new opportunities in others.

第二ラウンド:

AI: Let's refine our thinking:

1. Reassess the timeline of AI impact
   Explanation: The effects won't be immediate but will unfold over years or decades.

2. Consider the adaptability of the workforce
   Explanation: Retraining and education will be crucial for workers to transition to new roles.

3. Analyze potential societal changes
   Explanation: The nature of work itself might change, with more emphasis on creativity and emotional intelligence.

4. Examine global differences
   Explanation: AI's impact will vary across different countries and economies.

Refined Answer: AI's impact on the job market will be complex and gradual, requiring proactive measures in education and economic policy to ensure a smooth transition.

第三ラウンド:

AI: Let's delve deeper:

1. Explore the concept of human-AI collaboration
   Explanation: Many jobs may evolve to involve working alongside AI rather than being replaced by it.

2. Consider the ethical implications
   Explanation: Issues like algorithmic bias in hiring processes need to be addressed.

3. Analyze the potential for new economic models
   Explanation: Universal Basic Income or reduced working hours might become more prominent discussions.

4. Examine historical parallels
   Explanation: Previous technological revolutions, like the Industrial Revolution, can offer insights into potential outcomes.

Further Refined Answer: While AI will undoubtedly transform the job market, its impact will likely be nuanced, involving collaboration between humans and AI, ethical considerations, and potentially new economic paradigms.

整理:

AI: After careful consideration across multiple turns of reasoning, we can synthesize our thoughts on the potential impacts of artificial intelligence on the job market:

1. Job Transformation: AI will lead to significant changes in the job market, but these changes will be gradual and complex. While some jobs may be automated, many others will be transformed to involve collaboration between humans and AI. Industries like manufacturing, customer service, and data entry are likely to see the most immediate impacts.

2. New Opportunities: The rise of AI will create new job categories, particularly in fields like AI development, data science, AI ethics consultation, and human-AI interaction design. There will likely be an increased demand for skills in creativity, emotional intelligence, and complex problem-solving that AI cannot easily replicate.

3. Economic and Social Implications: The integration of AI into the workforce has the potential to increase productivity and economic growth. However, it also raises concerns about wealth distribution and may necessitate discussions about new economic models, such as Universal Basic Income or reduced working hours.

4. Education and Adaptation: The changing job market will require a strong emphasis on continuous learning and adaptation. Educational systems and workforce training programs will need to evolve to prepare people for the new reality of working alongside AI.

5. Ethical Considerations: As AI becomes more prevalent in hiring and work processes, addressing issues like algorithmic bias and ensuring fair opportunities for all workers will be crucial.

6. Global Variations: The impact of AI on the job market will not be uniform across the globe. Different countries and economies will experience varying effects based on their economic structures, technological readiness, and policy responses.

7. Historical Context: While AI represents a significant shift, it's important to view it in the context of previous technological revolutions. Like the Industrial Revolution, the AI revolution will likely lead to short-term disruptions but potentially long-term benefits if managed properly.

In conclusion, while AI will undoubtedly have profound impacts on the job market, these impacts will be multifaceted and evolve over time. The key to navigating this transition successfully lies in proactive measures in education, economic policy, and ethical governance, ensuring that the benefits of AI are broadly shared while mitigating potential negative effects.

マルチホイールアプローチにより、より精緻で包括的な分析が可能であることがわかります。これにより、さまざまな角度から問題を考え、思考を最適化し、最終的にはより深く包括的な詳細な回答を得ることができます。

Bowling氏は、このような複数の推論は、思考の深さ、自己改善、透明性、柔軟性の面で大きな利点があると述べています。また、Markdown 形式を使用することで、結果を読みやすくし、後のプロセスで使用することができます。

したがって、このテクノロジーにより、医療診断、法的分析、科学研究、ビジネス戦略、教育などの実用的なシナリオに AI を導入することができます。もちろん、Llamaberry などの複数ラウンドの推論システムを使用する場合は、偏見、計算コスト、過度の依存、プライバシーなどの倫理的な問題や限界に注意する必要があります。

Fusic 技術ブログ

Discussion