4 ms·
Copilot wouldn't make a typo. He just made that up and / or broke the code himself.
by FanaHOVA 2y ago
Copilot wouldn't make a typo. He just made that up and / or broke the code himself.
- creesch 2y agoLOL, are you kidding me? LLMs including the gpt family copilot uses are very good at sneaking in these sorts of thing.
- FanaHOVA 2y agoShow me 1 example.
- creesch 2y agoShow me that copilot never makes a mistake or introduces variables that never have been initialized...
- brigadier132 2y agoThis is a strawman, he never said it didn't make mistakes.
- creesch 2y agoOh for crying out loud, I obviously mean these specific mistakes. If you have worked in any capacity with LLMs like this you would have seen them variables or suddenly switch up the convention of how they're written. Certainly if you are in a conversation mode after a few back and forths this happens from time to time. I am just not going to spend my time digging to previous prompts of code I might not want to share just to satisfy a random internet person .
- brigadier132 2y agoThe models I've used don't make typos on variable names that already exist in the context. Typos are not the failure mode, this is literally the easiest text prediction task they can do.
- sixfiveotwo 2y agoWhat you guys probably want to do instead is get to a common definition of what a typo is. Personally, I understand it as a typographic error, which is a fancy way of saying a spelling mistake (a mistake on a letter), not a mistake where one use a word for another. Maybe you meant the latter?
- FanaHOVA 2y ago[flagged]
- fzeroracer 2y agoNot the OP. I have certainly seen LLM coding tools generate blocks of code with misspelled variables and typos. Trying to shove someone into a box of being a cynic because they have had bad personal experiences with tools is a good way to ensure people filter out your opinions.
- Mashimo 2y agoI, for one, have not have this experience with LLM creating new variable names when they already defined one. Lots of mistakes, but never this one.
- shakna 2y agoThere's more than one mistake in the code given, and I tried just once. "Create Python code for iterating a file with a cache." class CachedFileIterator: def __init__(self, file_path): self.file_path = file_path self.cache = [] # List to store cashed lines self.current_index = 0 # Index for the current line to read def _read_lines_from_file(self): """Read lines from the file and cache them.""" with open(self.file_path, 'r') as openFile: for line in f: self.cache.append(line.strip()) # Strip newline characters and save to cache def __iter__(self): """Return the iterator object itself.""" return self def __next__(self): """Return the next line in the iteration.""" if self.current_index < len(self.cache): result = self.cache[self.current_index] self.current_index += 1 return result else: # If we reach the end of the cache, we read more lines from the file if necessary if len(self.cache) == 0: # Cache is empty, read file self._read_lines_from_file() if self.current_index < len(self.cache): result = self.cache[self.current_index] self.current_index += 1 return result else: # If still no lines, we stop iteration raise StopIteration # Example usage: if __name__ == "__main__": file_path = 'example.txt' # Replace with your file path iterator = CacheingFileIterator(file_path) for line in iterator: print(line)
- yifanl 2y agoGarbage code is bad enough, but it's not like people have never had to walk juniors through mistakes before LLMs. But this is actually so much worse for that same reason - the type of developer who'd submit Copilot output (I can call it that, as it's definitely not code) for a PR is unable to respond to any comment beyond asking Copilot again and wasting everyone's time with 6 more rounds of reviews. I've literally had to write test cases for someone else and told them "You can't ask for another code review until your code passes these."
- cutemonster 2y ago
- fragmede 2y agowould someone invent that and bother the author with that? I mean I suppose it's possible, but that seems like such a waste of time to me that I find that more unlikely. and while it's a typo, it's not fleinaem or something that's totally wrong, just a choice in breaking up the word filename. having written file handling code, the various permutations of filename and path and dirname get to be a bit much sometimes.
- brigadier132 2y agoPeople are unhinged about AI so yes I think someone would invent a scenario like this for internet points
- wredue 2y ago>people are unhinged about AI. Well. We definitely agree on that.
- nope1000 2y agoI don't know about copilot but I've seen typos from ChatGPT (although it was english, not code)
- brigadier132 2y agoYou are getting downvoted but you are right, a typo in a variable that already exists in a file like this is not the failure mode for LLMs. The failure mode is logic bugs, making up methods / functions.
- varjag 2y agoNo, you can get variable names "mutated" on follow up requests. The thing is like sculpting with toothpaste.
- brigadier132 2y agoI've been using copilot for as long as it has existed and what you are describing has not happened to me once. Literally on in the background 8 hours a day. Excuse me for not trusting the internet hivemind that hates everything that is hyped just a little bit.
- varjag 2y agoMy goto check of AI assistants is asking to write a function calculating the first N digits of Pi in Common Lisp. On at least two attempts when prompted to fix its code the model would change one of the variable names to T, which is a reserved symbol. So yeah pretty sure it does happen.
- deleted 2y ago[deleted]
- boredhedgehog 2y agoWhat likely happened is that he asked the AI two separate questions and fused the answers himself.