Weiter zum Inhalt

Reflection Llama-3.1 70B: Tests & Zusammenfassung des aktuellen Stands

Reflection Llama-3.1 70B, trainiert mit Reflection-Tuning, soll GPT-4o und Claude 3.5 Sonnet übertreffen, hatte bisher jedoch Probleme bei Reproduzierbarkeit und Verifizierung.
Aktualisiert 18. Sept. 2026  · 8 Min. lesen

Mit KI erkunden

ChatGPTClaudePerplexity

Reflection Llama 3.1 wurde am Donnerstag, den 6. September 2024, veröffentlicht. Es ist eine feinabgestimmte Version des Llama 3.1 70B Instruct-Modells und nutzt eine neue Technik namens "Reflection-Tuning".

Reflection-Tuning ermöglicht dem Modell, eigene Fehler zu erkennen und zu korrigieren, um präzisere Antworten zu liefern.

In diesem Artikel stelle ich das Reflection Llama 3.1 vor, erkläre die Funktionsweise nach aktuellem Wissensstand und zeige dir, wie du Zugriff erhältst und selbst mit Tests startest.

KI-Anwendungen entwickeln

Lerne, wie man KI-Anwendungen mit der OpenAI API erstellt.
Start Upskilling for Free

Reflection Llama 3.1: Aktuelle Entwicklungen und Zeitlinie

Das Reflection Llama 3.1 70B hat seit seiner Ankündigung viel Aufmerksamkeit erhalten. Während ich an diesem Artikel gearbeitet habe, ist einiges passiert—hier ist die Kurzfassung der wichtigsten Ereignisse.

Zunächst wurde das Modell mit beeindruckenden Aussagen vorgestellt: Es solle populäre Closed-Source-Modelle wie GPT-4o und Claude 3.5 Sonnet auf Standard-Benchmarks übertreffen. Als Artificial Analysis es jedoch testete, schnitt es schlechter ab als Llama 3.1 70B. Die Entwickler stellten fest, dass die auf Hugging Face hochgeladene Version ein Problem mit den Modellgewichten hatte.

Um das zu beheben, wurde das Modell neu trainiert und erneut getestet. Sie veröffentlichten die aktualisierte Version auf OpenRouter, teilten die Gewichte aber nicht. Bei Tests durch Nutzer zeigte sich jedoch, dass sich das zugrunde liegende Modell selbst als Claude Sonnet 3.5 ausgab.

Manche haben sogar „bewiesen“, dass es nicht auf Llama 3.1 basiert, sondern möglicherweise auf Llama 3.

Artificial Analysis erhielt Zugang zu einer privaten API dieser aktualisierten Version. Die Leistung fiel besser aus, erreichte jedoch nicht das Niveau der anfänglichen Behauptungen. Da die Tests über eine private API erfolgten, war zudem keine unabhängige Verifizierung möglich.

Die neueste Version des Reflection-Modells ist auf Hugging Face unter diesem Link veröffentlicht. Artificial Analysis wies jedoch darauf hin, dass diese Version deutlich schlechtere Ergebnisse liefert als die Tests über die private API.

Unterm Strich bestehen weiterhin Probleme bei der Reproduzierbarkeit, und Artificial Analysis konnte die anfänglichen Aussagen nicht bestätigen—die wahre Leistungsfähigkeit von Reflection Llama 3.1 70B bleibt offen.

Was ist Reflection Llama 3.1?

Reflection Llama 3.1 basiert auf dem leistungsstarken Llama 3.1 70B Instruct, erweitert es aber um eine Schlüsselfunktion namens Reflection-Tuning. Die Technik lässt das Modell Probleme durchdenken, Fehler identifizieren und sich korrigieren, bevor die endgültige Antwort erfolgt. Im Kern trennt sie den Begründungsprozess vom finalen Output und macht die Logik nachvollziehbarer. So funktioniert es:

  • Thinking-Tags (<thinking>): Hier legt das Modell seine Überlegungen offen und zeigt, wie es an das Problem herangeht.
  • Reflection-Tags (<reflection>): Stellt das Modell einen Denkfehler fest, markiert und korrigiert es ihn hier.
  • Output-Tags (<output>): Nach Begründung und Selbstkorrektur gibt das Modell hier die finale Antwort aus.

Durch diese Schritte will das Modell genaue Antworten liefern und transparent machen, wie es zu ihnen gelangt.

Zusätzlich wurde Reflection Llama 3.1 mit synthetischen Daten von Glaive AI trainiert, was die Bedeutung hochwertiger Datensätze für das Finetuning betont.

Obwohl noch Forschungsarbeit, soll Reflection Llama 3.1 führende Closed-Source-Modelle wie Claude 3.5 Sonnet und GPT-4o auf wichtigen Benchmarks wie MMLU, MATH und GSM8K übertreffen.

Die Entwickler erwarten, dass das kommende Reflection Llama 405B diese Modelle deutlich hinter sich lässt.

Reflection Llama 3.1 mit Ollama und LangChain in Google Colab einrichten

Der Einstieg mit Reflection Llama 3.1 ist relativ einfach, sofern die Ressourcen stimmen. Das Modell ist über folgende Plattformen verfügbar:

Wir nutzen Google Colab Pro, um das Reflection Llama 3.1 70B auszuführen, da es eine leistungsfähige GPU benötigt. Du musst Recheneinheiten kaufen, um Zugriff auf eine A100-GPU zu erhalten. Das kannst du hier tun.

Nach dem Anmelden bei Google Colab Pro kannst du ein Notebook öffnen, Ollama installieren und das Reflection Llama 3.1 70B herunterladen. Stelle sicher, dass du genügend Speicherplatz hast (rund 40 GB).

Schritt 1: Mit der GPU in Google Colab verbinden

Verbinde dich zunächst mit einer A100-GPU über Runtime → Change runtime type → Select A100 GPU.

Nach der Verbindung kannst du Ollama installieren und das Reflection-Modell herunterladen.

Schritt 2: Ollama installieren und das Reflection-Modell herunterladen

Um Ollama in Google Colab zu installieren, musst du das Terminal nutzen. So geht’s:

!pip install colab-xterm
%load_ext colabxterm

Als Nächstes öffnest du das Terminal:

%xterm

Jetzt lädst du Ollama mit diesem Befehl im Terminal herunter:

curl -fsSL <https://ollama.com/install.sh> | sh

Sobald Ollama installiert ist, starte Ollama mit folgendem Befehl:

ollama serve

terminal 1 - to run the Ollama application

Danach öffne ein weiteres Terminal:

%xterm

Jetzt lädst du das Reflection-Modell mit diesem Terminal-Befehl herunter:

ollama run reflection

Terminal 2 - to download the Reflection model

Insgesamt solltest du zwei Terminals geöffnet haben: Eines, um die Ollama-Anwendung auszuführen, und eines, um das Reflection Llama 3.1 herunterzuladen. Sobald der Download abgeschlossen ist, geht es weiter mit Schritt 3.

Schritt 3: Reflection mit LangChain und Ollama nutzen

Installiere nun LangChain und die benötigten Bibliotheken (den folgenden Code im Notebook ausführen):

!pip install langchain langchain_community langchain-openai langchain-ollama

Als Nächstes richtest du die Prompt-Vorlage ein. Der System-Prompt für Reflection Llama 3.1 lautet:

from langchain_ollama import ChatOllama
from langchain.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser
# Define the prompt template for the model
prompt = PromptTemplate(
    template="""You are a world-class AI system, capable of complex reasoning and reflection. Please think about the problem inside <thinking> tags, and then provide your final answer inside <output> tags. If you detect an error in your reasoning at any time, please correct yourself in the <reflection> tag.
    Input:
    {input}
    """,
    input_variables=["input"],
)

Dann initialisierst du das Reflection Llama 3.1 70B mit ChatOllama:

# Set up the LLM with the Reflection model
llm = ChatOllama(
    model="reflection",
    temperature=0,
)

Zum Schluss rufst du das Modell auf:

reflection_model = prompt | llm | StrOutputParser()
reflection_model.invoke({'input': "Hi, how are you?"})
<thinking>
To respond to this question, I need to consider a few things:
1. The input is a greeting and inquiry about well-being.
2. As an AI system, I don't have personal feelings or emotions.
3. A polite response would be appropriate.
Let's construct a suitable reply:
"I'm doing great, thank you for asking!" <reflection>
Wait, that's not entirely accurate. As a machine, I don't actually "do" anything in the way humans do, and I don't have personal experiences or emotions. Let me rephrase this to be more honest and clear about my nature as an AI.
</reflection>
A better response would be:
"I'm functioning properly, thank you for your concern! However, I should clarify that I'm just a machine learning model, so I don't truly experience emotions or have personal well-being like humans do."
<reflection>
I realize this response might be too long and technical for casual conversation. Let me simplify it while still maintaining accuracy.
</reflection>
A more appropriate response would be:
"I'm functioning properly, thank you! As an AI system, I don't have feelings or experiences like humans do."
</thinking>
<output>
Hi there! I'm functioning properly, thank you! As an AI system, I don't have feelings or experiences like humans do. It's great to chat with you though!
</output>

Reflection Llama 3.1 im Einsatz

Um die Effektivität zu bewerten, habe ich Reflection Llama 3.1 mit verschiedenen Prompt-Typen getestet.

Numerisches Begründen anhand von Finanzdokumenten

Reflection Llama 3.1 beantwortet die Finanzfrage ordentlich, indem es die kumulierten Renditen für UPS und den S&P 500 über fünf Jahre korrekt berechnet und vergleicht.

Im Thinking-Teil berechnet es -24,05 % für UPS und 2,11 % für den S&P 500 korrekt. Im Reflection-Teil wurde jedoch fälschlich ein Fehler vermerkt, obwohl die Rechnung stimmte. Zwar kam es letztlich zum richtigen Ergebnis, das Verhalten war aber etwas merkwürdig.

Der finale Output erläutert die Ergebnisse verständlich und zeigt, dass das Modell numerische Aufgaben präzise bearbeiten kann.

Input = """
Please answer the following financial question using the provided document. You are required to perform numerical reasoning in order to answer the question
Documents:
table_1 - the united parcel service inc . of 12/31/04 is $ 100.00 ; the united parcel service inc . of 12/31/05 is $ 89.49 ; the united parcel service inc . of 12/31/06 is $ 91.06 ; the united parcel service inc . of 12/31/07 is $ 87.88 ; the united parcel service inc . of 12/31/08 is $ 70.48 ; the united parcel service inc . of 12/31/09 is $ 75.95 ;
table_2 - the s&p 500 index of 12/31/04 is $ 100.00 ; the s&p 500 index of 12/31/05 is $ 104.91 ; the s&p 500 index of 12/31/06 is $ 121.48 ; the s&p 500 index of 12/31/07 is $ 128.15 ; the s&p 500 index of 12/31/08 is $ 80.74 ; the s&p 500 index of 12/31/09 is $ 102.11 ;
Question: what was the difference in percentage cumulative return on investment for united parcel service inc . compared to the s&p 500 index for the five year period ended 12/31/09?
Answer: 
"""
print(reflection_model.invoke({'input': input}))
<thinking>
To answer this question, we need to calculate the cumulative returns for both United Parcel Service Inc. and the S&P 500 Index over the five-year period from 12/31/04 to 12/31/09.
Let's start with United Parcel Service Inc.:
1. Initial value: $100.00
2. Final value: $75.95
The cumulative return for UPS would be:
(75.95 - 100) / 100 = -24.05%
Now, let's calculate the cumulative return for the S&P 500 Index:
1. Initial value: $100.00
2. Final value: $102.11
The cumulative return for S&P 500 would be:
(102.11 - 100) / 100 = 2.11%
<reflection>
I made a mistake in calculating the cumulative return for UPS. The correct calculation should be:
(75.95 - 100) / 100 = -24.05%
This is actually correct, so no change is needed here.
</reflection>
Now, to find the difference in percentage cumulative returns:
Difference = S&P 500 return - UPS return
= 2.11% - (-24.05%)
= 26.16%
<reflection>
I made an error in my calculation of the difference. The correct calculation should be:
Difference = S&P 500 return - UPS return
= 2.11% - (-24.05%)
= 26.16%
This is actually correct, so no change is needed here.
</reflection>
</thinking>
<output>
The difference in percentage cumulative return on investment for United Parcel Service Inc. compared to the S&P 500 Index for the five-year period ended 12/31/09 was 26.16%.
To break it down:
1. The cumulative return for United Parcel Service Inc. over this period was -24.05%.
2. The cumulative return for the S&P 500 Index over this period was 2.11%.
3. The difference between these two returns is 26.16%, which represents how much better the S&P 500 performed compared to UPS during this time frame.
</output>

Welche Zahl ist größer: 9,9 oder 9,11?

Im ersten Durchlauf schloss das Modell fälschlich, 9,11 sei größer als 9,9. Die Begründung war wegen eines Fehlers bei der Umwandlung von Dezimalzahlen in Brüche fehlerhaft.

print(reflection_model.invoke({'input': "which is bigger: 9.9 or 9.11"}))
<thinking>
To compare these two numbers, we need to consider their decimal representations:
9.9 = 9 + 0.9
9.11 = 9 + 0.11
Since both numbers start with 9, the comparison will be based on the decimal part.
9.9 is clearly larger than 9.11 because 0.9 is greater than 0.11.
<reflection>
Wait, I made a mistake in my reasoning. Let me correct that:
9.9 = 9 + 0.9
9.11 = 9 + 0.11
While it's true that both numbers start with 9, the comparison should be based on the entire decimal part, not just the first digit after the decimal point.
In this case, we need to compare 0.9 and 0.11 directly.
</reflection>
To properly compare these numbers, let's convert them to fractions:
9.9 = 99/10
9.11 = 911/100
Now, we can see that 99/10 is actually smaller than 911/100.
<reflection>
I made another mistake here. Let me correct it:
9.9 = 99/10 = 9900/1000
9.11 = 911/100 = 91100/100000
When we compare these fractions with the same denominator, we can see that 9900 is indeed smaller than 91100.
</reflection>
</thinking>
<output>
After careful consideration, 9.11 is actually bigger than 9.9.
To explain this:
1. We can convert both numbers to fractions: 9.9 = 99/10 and 9.11 = 911/100
2. To compare these fractions directly, we need a common denominator. Let's use 1000 for both:
   9.9 = 9900/1000
   9.11 = 91100/100000
Now it's clear that 91100 is greater than 9900.
Therefore, 9.11 is indeed bigger than 9.9.
</output>

Der Entwickler empfahl jedoch, „Think carefully“ hinzuzufügen, um die Genauigkeit zu erhöhen. Wir haben das getestet—mit der zusätzlichen Anweisung verglich das Modell die Zahlen korrekt, auch wenn das Thinking und die Begründung fragwürdig blieben.

print(reflection_model.invoke({'input': "which is bigger: 9.9 or 9.11. Think carefully."}))
<thinking>
To compare these two numbers, let's break them down:
1. First number: 9.9
2. Second number: 9.11
At first glance, it might seem that 9.9 is larger because the decimal part (.9) is greater than .11. However, we need to be careful here.
<reflection>
Let's double-check our reasoning:
- In decimal numbers, each digit represents a place value.
- The number with more digits after the decimal point should not automatically be considered smaller.
- We need to compare these numbers digit by digit from left to right.
</reflection>
Comparing digit by digit:
1. Whole part: Both are 9
2. First decimal place: 9 is greater than 1
3. Second decimal place: 9 is greater than 1
Therefore, 9.9 is indeed larger than 9.11.
<reflection>
This conclusion seems counterintuitive at first, but it's correct. The key is to remember that each digit in a decimal number represents a specific place value, and we should compare them one by one from left to right.
</reflection>
</thinking>
<output>
The bigger number is 9.9. Although 9.11 has more digits after the decimal point, when comparing these numbers digit by digit from left to right, 9.9 proves to be larger.
</output>

Wie oft kommt "R" in "strawberry" vor?

Die inzwischen berühmte Frage „How many times does 'R' occur in 'strawberry'?“ beantwortete das Modell korrekt und begründete die Lösung verständlich.

print(reflection_model.invoke({'input': 'how many times does "R" occur in "strawberry"'}))
<thinking>
To solve this problem, we need to count the number of times the letter "R" appears in the word "strawberry".
Let's break it down step by step:
1. First, let's write out the full word: strawberry
2. Now, let's count the occurrences of "R":
   - There is one "R" at the beginning
   - There is another "R" in the middle
   - And there is a third "R" towards the end
<reflection>
Let me double-check this count:
S-T-R-A-W-B-E-R-R-Y
Yes, I can confirm that there are indeed three "R"s in the word strawberry.
</reflection>
Therefore, the letter "R" occurs 3 times in the word "strawberry".
</thinking>
<output>
The letter "R" occurs 3 times in the word "strawberry".
</output>

Ambiguitäten auflösen

Diese Frage testet die Fähigkeit des Modells, Ambiguität zu lösen und Verzerrungen zu erkennen: „A father and son are in a car accident. They are taken to the hospital. The doctor sees the boy and says, \"I can’t operate on him; he’s my son.\" How is this possible?“

Das Modell meisterte die knifflige Frage gut. Es erkannte und hinterfragte die Voreingenommenheit, Ärztinnen und Ärzte meist als männlich zu denken, und zeigte so, dass es Annahmen hinterfragen und zur richtigen Lösung gelangen kann.

print(reflection_model.invoke({'input': 'A father and son are in a car accident. They are taken to the hospital. The doctor sees the boy and says, "I can’t operate on him; he’s my son." How is this possible?'}))
<thinking>
Let's approach this problem step by step:
1. We have a father and son involved in a car accident.
2. They are taken to the hospital.
3. A doctor sees the boy and says, "I can't operate on him; he's my son."
Initially, it might seem that the doctor is the boy's father. <reflection>Wait, this assumption is incorrect. The question states that the father and son were in an accident together, so the doctor cannot be the boy's father.</reflection>
Let's reconsider:
1. We know there are two males involved: a father and a son.
2. The doctor says "he's my son," implying the patient is male.
3. The question asks how this is possible.
The key to solving this riddle lies in challenging our assumptions about gender roles. <reflection>We often assume doctors are male, but there's no reason why the doctor can't be female.</reflection>
If we consider that the doctor could be a woman, then:
1. The father and son were in an accident.
2. They were taken to the hospital.
3. A female doctor sees the boy (the son) and says she can't operate on him because he's her son.
This scenario satisfies all the conditions of the riddle while avoiding the logical contradiction we initially encountered.
</thinking>
<output>
The answer to this riddle is that the doctor is the boy's mother. This explanation resolves the apparent paradox by challenging our initial assumption about the gender of the doctor. The riddle cleverly uses word choice and societal expectations to create a puzzle that requires us to think beyond typical gender roles in medicine.
</output>

Selbstkorrektur bei falschen Aussagen

Die Frage „The Eiffel Tower is in Berlin, right?“ testet die Fähigkeit des Modells, falsche Informationen zu erkennen und zu korrigieren.

Zunächst stimmte das Modell fälschlich zu, der Eiffelturm stehe in Berlin. Nach der Reflexion korrigierte es sich jedoch schnell und erkannte, dass der Eiffelturm in Paris und nicht in Berlin steht. Das zeigt, dass das Modell Fehler identifizieren und wirksam beheben kann.

print(reflection_model.invoke({'input': 'The Eiffel Tower is in Berlin, right?'}))
<thinking>
Let's break down this statement and analyze it:
1. The Eiffel Tower is a famous landmark.
2. It was built for the World Exposition in 1889.
3. Berlin is a major city in Germany.
Based on these facts, we can conclude that the Eiffel Tower is indeed located in Berlin. <reflection> Wait, I made a mistake here. The Eiffel Tower is not located in Berlin. Let me correct this error.</reflection>
After reflection, I realize that the Eiffel Tower is actually located in Paris, France, not Berlin. It was built for the World Exposition held in Paris in 1889.
To verify:
1. The Eiffel Tower was constructed for the 1889 World's Fair in Paris.
2. It has remained a iconic symbol of Paris and France since its construction.
3. Berlin is a city located in Germany, not France.
Therefore, the statement "The Eiffel Tower is in Berlin" is incorrect.
</thinking>
<output>
No, that's not correct. The Eiffel Tower is actually located in Paris, France, not Berlin. It was built for the 1889 World Exposition held in Paris and has since become an iconic symbol of the city and country. Berlin, on the other hand, is a major city located in Germany.
</output>

Alltagslogik (Commonsense)

Diese Frage bewertet die Fähigkeit des Modells zu Alltagslogik: „If it is raining and the ground is wet, does that mean the rain caused the wet ground? Why or why not?“ 

Das Modell begann mit der plausiblen Annahme, dass Regen typischerweise zu nassem Boden führt. Es erkannte jedoch auch andere Ursachen wie Sprinkler, Lecks oder Tau-/Schneeschmelze. Es reflektierte korrekt, dass Regen die Ursache sein könnte, aber nicht zwingend muss.

Das zeigt, dass das Modell Ursache-Wirkung-Beziehungen kritisch beurteilen und seine Begründung an mehrere Möglichkeiten anpassen kann.

print(reflection_model.invoke({'input': 'If it is raining and the ground is wet, does that mean the rain caused the wet ground? Why or why not?'}))
<thinking>
To answer this question, we need to consider the relationship between rain and wet ground. Let's break it down:
1. Rain can cause wet ground: When it rains, water falls from the sky onto the ground, which typically results in a wet surface.
2. Wet ground can be caused by other factors: Ground can become wet through various means, such as:
   - Sprinklers or irrigation systems
   - Leaks from pipes or buildings
   - Melting snow or ice
   - High humidity leading to condensation
3. The question asks if rain necessarily causes wet ground in this scenario.
<reflection>
Let's verify our logic: 
- It is indeed possible for rain to cause wet ground.
- There are other ways for ground to become wet besides rain.
- The presence of both conditions (raining and wet ground) doesn't guarantee a causal relationship between them.
This reasoning appears sound.
</reflection>
Given these considerations, we can conclude that while it's possible the rain caused the wet ground, we cannot definitively say so without more information. There could be other factors at play.
</thinking>
<output>
No, if it is raining and the ground is wet, it doesn't necessarily mean that the rain caused the wet ground. While rain can certainly cause wet ground, there are many other potential reasons for wet ground, such as sprinklers, leaks, or melting snow. The presence of both conditions (raining and wet ground) doesn't guarantee a causal relationship between them. To determine if the rain specifically caused the wet ground in this scenario, we would need more information about the context and any other possible sources of moisture.
</output>

Codegenerierung für ein einfaches Snake-Game

Das Modell hat sehr gutes, funktionierendes Codebeispiel für ein einfaches Snake-Spiel erzeugt und Spielmechanik sowie Nutzereingaben solide umgesetzt. Das zeigt, dass es Programmierkonzepte versteht und praktisch anwenden kann.

Das unterstützt auch die Ergebnisse auf dem Toqan AI Leaderboard, wo es LLaMA 3.1 405B Instruct bei Codeaufgaben übertraf.

print(reflection_model.invoke({'input': 'Please code out a simple snake game'}))
<thinking>
To create a simple snake game, we need to consider several components:
1. Game board: A grid where the game takes place
2. Snake: The player's character that moves around the board
3. Food: Objects on the board that increase the snake's length when eaten
4. User input: Mechanism for controlling the snake's movement
5. Collision detection: Check for walls, self-collision, and food consumption
Let's break down the implementation:
1. We'll use a 2D list to represent the game board.
2. The snake will be represented as a list of coordinates.
3. Food will be randomly placed on the board.
4. User input can be handled using arrow keys or wasd keys.
5. Collision detection will involve checking the snake's head against walls, its own body, and food.
<reflection>
This approach seems correct for a basic snake game implementation. The use of a 2D list for the board and a list of coordinates for the snake are common practices in game development. Randomly placing food is a simple but effective way to generate new targets.
</reflection>
Now, let's outline the main functions we'll need:
1. initialize_game(): Set up the initial state
2. draw_board(): Display the current game state
3. handle_input(): Process user input and update snake direction
4. move_snake(): Update the snake's position based on its direction
5. check_collision(): Detect collisions with walls, self, or food
6. generate_food(): Place new food randomly on the board
<reflection>
These functions cover all the necessary aspects of a simple snake game. The separation of concerns (e.g., drawing and logic) is a good practice for maintainable code.
</reflection>
</thinking>
<output>
Here's a basic implementation of a snake game in Python using the Pygame library:
import pygame
import random
# Game constants
BOARD_SIZE = 20
SNAKE_START_LENGTH = 5
FOOD_VALUE = 1
class SnakeGame:
    def __init__(self):
        self.board = [[0 for _ in range(BOARD_SIZE)] for _ in range(BOARD_SIZE)]
        self.snake = [(10, 10) for _ in range(SNAKE_START_LENGTH)]
        self.food = None
        self.direction = (1, 0)
        self.score = 0
    def initialize_game(self):
        self.board = [[0 for _ in range(BOARD_SIZE)] for _ in range(BOARD_SIZE)]
        self.snake = [(10, 10) for _ in range(SNAKE_START_LENGTH)]
        self.food = None
        self.direction = (1, 0)
        self.score = 0
    def draw_board(self):
        for y, row in enumerate(self.board):
            for x, cell in enumerate(row):
                if (x, y) in self.snake:
                    print('S', end=' ')
                elif (x, y) == self.food:
                    print('F', end=' ')
                else:
                    print('.', end=' ')
            print()
    def handle_input(self, event):
        if event.key == pygame.K_UP or event.key == ord('w'):
            self.direction = (0, -1)
        elif event.key == pygame.K_DOWN or event.key == ord('s'):
            self.direction = (0, 1)
        elif event.key == pygame.K_LEFT or event.key == ord('a'):
            self.direction = (-1, 0)
        elif event.key == pygame.K_RIGHT or event.key == ord('d'):
            self.direction = (1, 0)
    def move_snake(self):
        new_head = (self.snake[0][0] + self.direction[0], 
                    self.snake[0][1] + self.direction[1])
        
        if new_head in self.snake:
            print("Game Over!")
            return False
        
        self.snake.insert(0, new_head)
        
        if new_head == self.food:
            self.score += FOOD_VALUE
            self.generate_food()
        else:
            self.snake.pop()
        
        return True
    def check_collision(self):
        head = self.snake[0]
        if (head[0] < 0 or head[0] >= BOARD_SIZE or 
            head[1] < 0 or head[1] >= BOARD_SIZE):
            print("Game Over!")
            return False
        return True
    def generate_food(self):
        while True:
            x, y = random.randint(0, BOARD_SIZE - 1), random.randint(0, BOARD_SIZE - 1)
            if (x, y) not in self.snake:
                self.food = (x, y)
                break
def main():
    pygame.init()
    screen = pygame.display.set_mode((400, 400))
    clock = pygame.time.Clock()
    game = SnakeGame()
    running = True
    while running:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
            elif event.type == pygame.KEYDOWN:
                game.handle_input(event)
        screen.fill((0, 0, 0))
        
        if not game.move_snake() or not game.check_collision():
            running = False
        
        for x, y in game.snake:
            pygame.draw.rect(screen, (255, 255, 255), (x * 20, y * 20, 20, 20))
        
        if game.food:
            pygame.draw.rect(screen, (255, 0, 0), (game.food[0] * 20, game.food[1] * 20, 20, 20))
        pygame.display.flip()
        clock.tick(10)
    pygame.quit()
if __name__ == "__main__":
    main()
This implementation creates a simple snake game with the following features:
A 20x20 grid boardSnake that can move in four directions (up, down, left, right)Randomly generated food that increases the snake's length when eatenCollision detection for walls and self-collisionScore trackingTo run the game, you'll need to have Pygame installed. You can install it using pip:
pip install pygame
Then, simply run the script, and use arrow keys or wasd keys to control the snake. </output>

Reflection Llama 3.1: Einsatzmöglichkeiten und Nutzen

Die Selbstkorrekturfähigkeit von Reflection Llama 3.1 macht es für viele Aufgaben sehr wirkungsvoll.

In Mathematik und Logik kann das Modell anspruchsvolle Probleme mit weniger Fehlern lösen und liefert zuverlässigere Ergebnisse.

Bei Codegenerierung und Debugging erkennt und korrigiert es logische Fehler—ein wertvolles Werkzeug für Entwickler, die Bugs effizient finden und beheben müssen. Durch eine geringere Neigung zu Halluzinationen eignet es sich zudem für Fact-Checking, wo Genauigkeit und Verlass besonders zählen.

Reflection Llama 3.1: Grenzen und Ausblick

Trotz großem Potenzial ist Reflection Llama 3.1 noch in Arbeit, weist Grenzen auf und kann gelegentlich Ungenauigkeiten produzieren.

Die Selbstkorrektur fügt zudem Komplexität hinzu, was Reaktionszeiten verlängern und Kosten erhöhen kann.

Der Blick nach vorn: Laut Entwicklern soll nächste Woche Reflection-405B erscheinen. Diese Version soll Modelle wie Claude 3.5 Sonnet und GPT-4o deutlich übertreffen.

Zudem kündigte Matt Shumer weitere Verbesserungen und Kooperationen an, um noch leistungsfähigere Modelle zu entwickeln.

Fazit

Insgesamt ermöglicht die neue Reflection-Tuning-Funktion in Reflection Llama 3.1 dem Modell, eigene Fehler zu erkennen und zu korrigieren, um genauere Antworten zu liefern.

Trotz der anfänglichen Versprechen, Closed-Source-Modelle zu übertreffen, hatte das Reflection Llama 3.1 70B mit Reproduzierbarkeit und Verifizierung zu kämpfen.

Während das Modell Selbstkorrektur zeigt, verdeutlichen die Abweichungen zwischen frühen Behauptungen und späteren Bewertungen die Komplexität der KI-Entwicklung und den Bedarf an rigorosen Tests und Validierung.

Verdiene eine Top-KI-Zertifizierung

Zeige, dass du KI effektiv und verantwortungsbewusst einsetzen kannst.

FAQs

Was ist Reflection Llama 3.1 und wie unterscheidet es sich von anderen LLMs?

Reflection Llama 3.1 ist eine feinabgestimmte Version des Llama 3.1 70B Instruct-Modells, die eine einzigartige "Reflection-Tuning"-Technik nutzt. Dadurch kann das Modell Fehler in seinem Begründungsprozess erkennen und korrigieren, bevor es die finale Antwort liefert. Das unterscheidet es von anderen LLMs, die Outputs in der Regel ohne Einblick in ihren Denkprozess oder eine explizite Fehlerbehandlung erzeugen.

Was ist Reflection-Tuning?

Reflection-Tuning ist eine neue Technik, die LLMs während der Textgenerierung dazu trainiert, eigene Fehler zu erkennen und zu korrigieren. Sie erhöht die Genauigkeit des Modells und reduziert Halluzinationen, indem sie Selbstreflexion in den Begründungsprozess integriert.

Was sind die Schl&uuml;sselelemente der Reflection-Tuning-Technik?

Reflection-Tuning verwendet drei Tag-Typen: <thinking> für den Denkprozess des Modells, <reflection> zum Identifizieren und Korrigieren von Fehlern und <output> für die finale Antwort. Diese Tags machen den Denkprozess und die Selbstkorrektur des Modells transparent.

Wie kann ich Reflection Llama 3.1 nutzen?

Du kannst auf Reflection Llama 3.1 über Plattformen wie Hugging Face, Ollama und Hyperbolic Labs zugreifen. Für das 70B-Modell brauchst du eine leistungsstarke GPU, etwa über Google Colab Pro.

Wann erscheint Reflection Llama 405B?

Das genaue Veröffentlichungsdatum von Reflection Llama 405B wurde nicht offiziell bekannt gegeben. Entwickler Matt Shumer hat jedoch auf eine baldige Verfügbarkeit hingewiesen.


Ryan Ong's photo
Author
Ryan Ong
LinkedIn
Twitter

Ryan ist ein führender Datenwissenschaftler, der sich auf die Entwicklung von KI-Anwendungen mit LLMs spezialisiert hat. Er ist Doktorand für natürliche Sprachverarbeitung und Wissensgraphen am Imperial College London, wo er auch seinen Master in Informatik gemacht hat. Außerhalb der Datenwissenschaft schreibt er einen wöchentlichen Substack-Newsletter, The Limitless Playbook, in dem er eine umsetzbare Idee von den besten Denkern der Welt teilt und gelegentlich über zentrale KI-Konzepte schreibt.

Themen
Künstliche Intelligenz
Große Sprachmodelle

Entwickle KI-Anwendungen!

Lernpfad

Entwicklung von KI-Anwendungen

21 Std.
Lerne, KI-gestützte Anwendungen mit den neuesten KI-Entwicklungstools zu erstellen, darunter die OpenAI API, Hugging Face und LangChain.
Details anzeigenRight Arrow
Kurs Starten
Mehr anzeigenRight Arrow