One of my main frustrations with LLMs is the way they make mistakes. To me, the seemingly random insertion of incorrect or hallucinated code fundamentally contradict how I usally read and think about code. For example, reacently I tried to find all the red sections in an image with some Python code, and I had a rough idea of how it should work. An image is essentially and array of pixels and each pixel is a set of numbers representing it’s color. A format called RGB is commonly used for this, where each pixel consist of three number in the range of 0-255, representing how much red, green and blue light make up the pixel. You loop over the array and check whether the color values of a pixel fall with a range that would be red, meaning it should have high values for red, and lower values for green and blue.
Read more