ChatGPT & LLMs: Can AI Write My Code?

Large Language Models are the biggest tech shift since the iPhone. How do they work? And should you use them for robotics coding?

ChatGPT & LLMs: Can AI Write My Code?

You ask ChatGPT: “Write an FTC Auton using RoadRunner.” It spits out code. Is it magic? Is it thinking? No. It is Next Token Prediction.

The Super-Autocorrect

Imagine the autocorrect on your phone, but trained on the entire internet.

  • “The cat sat on the…” -> (Mat? Hat? Bed?).
  • ChatGPT calculates the probability of the next word based on billions of examples.
  • It doesn’t “know” Java. It just knows that after public static void, the next word is usually main.

The Hallucination Danger

Because it is guessing, it lies cleanly. It might invent a function called robot.doBackflip() that doesn’t exist. It looks correct. It feels correct. But the compiler will scream errors.

The Tool, Not the Creator

  • Bad Engineer: “Write my whole robot code.” (Result: Broken code, unhappy robot).
  • Good Engineer: “Write a function to calculate the hypotenuse of a triangle.” (Result: Perfect math helper). Use AI to handle the boring syntax, but YOU must be the architect who understands the logic.

Explore FIRST® Robotics

FIRST® (For Inspiration and Recognition of Science and Technology) is a global robotics community preparing young people for the future. Discover the ultimate sport for the mind and see how you can get involved in STEM and robotics!

Learn More at firstinspires.org