Skip to content

Latest commit

 

History

History
510 lines (455 loc) · 17.1 KB

Readme.md

File metadata and controls

510 lines (455 loc) · 17.1 KB

LLM Python Raytracer - Benchmark Experiment

This repository contains various Python raytracer implementations generated by different Large Language Models (LLMs) using a single prompt and one attempt.

Prompt Used

The following prompt was used for all LLMs:

Write a raytracer that renders an interesting scene with many colourful lightsources in python. Output a 800x600 image as a png

Implementations

The following LLMs did not return properly functioning code: Grok3-thinking, DeepSeek-R1, Le Chat (Mistral Large 2), 8b models, llama3-405b/70b, llama3-hermes3-405b/70b, Hunyuan-T1,Qwen3-235, Qwen3.5-397B-A17B. Generally, the R1-adjacent reasoning models tend to overthink code fragments and then come up with dysfunctional code.

Results

Performance Notes

  • Most implementations take several minutes to render, which is not unexpected for a Python raytracer. (Try C next? :D)
  • Performance varies between implementations, with some taking significantly longer to complete
  • DeepSeek R1 spent 566 thinking and then outputted a broken file. I was not able to restart due to a busy server.
  • 4o's first attempt required corrections, but the second attempt was successful

Output Images for different LLMs

Claude Sonnet 3.5 (new)
Claude Sonnet 3.5 (new)
Claude Sonnet 3.7
Claude Sonnet 3.7
Claude Sonnet 3.7 Thinking
Claude Sonnet 3.7 Thinking
GPT-4o
GPT-4o
DeepSeek v3
DeepSeek v3
Gemini Flash Thinking
Gemini Flash Thinking
Gemini 2 Flash
Gemini 2 Flash
Grok 2
Grok 2
Grok 3
Grok 3
O1
O1
O3-Mini
O3-Mini
Qwen Max
Qwen Max
GPT-4.5
GPT-4.5
QwQ32B
QwQ32B
Codestral
Codestral
DeepSeek_v3_0324
Deepseek V3 0324
Gemini 2.5 pro exp
Gemini 2.5 pro exp
llama3_3_70b
LLama 3.3 70b
Quasar Alpha
Quasar Alpha
Optimus Alpha
Optimus Alpha

Variability test

Since the tests above are based on one-shot prompts, they are not necessarily representative of the LLM's average capabilities. I ran the experiment 4 times with Sonnet-3.5, Sonnet-3.7, GPT4.5 and grok3 to test for consistency.

We can clearly see a significant change in behavior between the two models. Sonnet-3.5 produces slight variations of a basic scene with red, green and blue spheres, while Sonnet-3.7 uses more objects, colors and more variations in general. GPT 4.5 and Grok3 are also more of a three-sphere llm.

Claude Sonnet 3.5 Variance Test

Sonnet 3.5 - Test 1 Sonnet 3.5 - Test 2 Sonnet 3.5 - Test 3 Sonnet 3.5 - Test 4

Claude Sonnet 3.7 Variance Test

Sonnet 3.7 - Test 1 Sonnet 3.7 - Test 2 Sonnet 3.7 - Test 3 Sonnet 3.7 - Test 4

DeepSeek V3 (original) Variance Test

DeepSeek V3 - Test 1 DeepSeek V3 - Test 2 DeepSeek V3 - Test 3 DeepSeek V3 - Test 4

DeepSeek V3 (0324) Variance Test

DeepSeek V3 (0324) - Test 1 DeepSeek V3 (0324) - Test 2 DeepSeek V3 (0324) - Test 3 DeepSeek V3 (0324) - Test 4

GPT 4.5 Variance Test

GPT 4.5 - Test 1 GPT 4.5 - Test 2 GPT 4.5 - Test 3 GPT 4.5 - Test 4

Grok3 Variance Test

Grok 3 - Test 1 Grok 3 - Test 2 Grok 3 - Test 3 Grok 3 - Test 4

Gemini 2.5 Pro Exp Variance Test

Gemini 2.5 pro Exp - Test 1 Gemini 2.5 pro Exp - Test 2 Gemini 2.5 pro Exp - Test 3 Gemini 2.5 pro Exp - Test 4

Gemini 2.5 Pro 0506 Variance Test

Gemini 2.5 pro 0506 - Test 1 Gemini 2.5 pro 0506 - Test 2 Gemini 2.5 pro 0506 - Test 3 Gemini 2.5 pro 0506 - Test 4

Quasar Alpha Variance Test

Grok 3 - Test 1 Grok 3 - Test 2 Grok 3 - Test 3 Grok 3 - Test 4

Optimus Alpha Variance Test

Optimus Alpha - Test 1 Optimus Alpha - Test 2 Optimus Alpha - Test 3 Optimus Alpha - Test 4

Llama4 Scout Variance Test

llama4-scout - Test 1 llama4-scout - Test 2 llama4-scout - Test 3 llama4-scout - Test 4

Llama4 Maverick Variance Test

llama4-maverick - Test 1 llama4-maverick - Test 2 llama4-maverick - Test 3 llama4-maverick - Test 4

o4-Mini High Variance Test

o4-Mini High - Test 1 o4-Mini High - Test 2 o4-Mini High - Test 3 o4-Mini High - Test 4

Opus 4.6 Variance Test

Opus 4.6 - Test 1 Opus 4.6 - Test 2 Opus 4.6 - Test 3

Gemini 3 Pro Variance Test

Gemini 3 Pro - Test 1 Gemini 3 Pro - Test 2 Gemini 3 Pro - Test 3

GPT5.3-Codex-Extra High Variance Test

GPT5.3-Codex-Extra High - Test 1 GPT5.3-Codex-Extra High - Test 2 GPT5.3-Codex-Extra High - Test 3

Sonnet 4.6 Variance Test

Sonnet 4.6 - Test 1 Sonnet 4.6 - Test 2 Sonnet 4.6 - Test 3

Grok 4.2 Variance Test

Grok 4.2 - Test 1 Grok 4.2 - Test 2 Grok 4.2 - Test 3 Grok 4.2 - Test 4

Gemini 3.1 Pro Variance Test

Gemini 3.1 Pro - Test 1 Gemini 3.1 Pro - Test 2 Gemini 3.1 Pro - Test 3 Gemini 3.1 Pro - Test 4

File sizes

There is a notable correlation between code creativity and file size.