News for hackers. Stuff that matters.
Re:Ask HN: Did you encounter any leap year bugs today? by jewel on Thursday February 29, 2024 @05:47PM (#39556252)
We have a product that uses ChatGPT via the API, using the 3.5 turbo version. Our query involves some dates. Instead of giving back text like it usually does, today it has been giving errors because it does not think 2024-02-29 is a valid date.

This is easy to reproduce with the web interface, at least sometimes [0]. It start out by saying it's not a valid date and then as it's explaining why it isn't it realizes its mistake and sometimes corrects itself.

[0] https://chat.openai.com/share/37490c9f-81d6-499f-b491-116536...

Re:Ask HN: Did you encounter any leap year bugs today? by baron816 on Thursday February 29, 2024 @08:07PM (#39557318)
ChatGPT thinks today is March 1. Go ahead and ask it what today’s date is.
Re:Ask HN: Did you encounter any leap year bugs today? by huytersd on Thursday February 29, 2024 @08:34PM (#39557480)
> No, 2024 is not a leap year. Leap years are years divisible by 4, except for years that are divisible by 100 unless they are also divisible by 400. Therefore, the next leap year will be 2024.
Re:Ask HN: Did you encounter any leap year bugs today? by rodface on Thursday February 29, 2024 @08:58PM (#39557649)
As the proud new owner of a leap day baby, I find this to be extra hilarious
Re:Ask HN: Did you encounter any leap year bugs today? by pizzafeelsright on Thursday February 29, 2024 @10:35PM (#39558264)
I was at the hospital and heard two babies being born. I love that music.
Re:Ask HN: Did you encounter any leap year bugs today? by heywoods on Thursday February 29, 2024 @09:48PM (#39557984)
Congratulations!
Re:Ask HN: Did you encounter any leap year bugs today? by hilux on Friday March 01, 2024 @03:44AM (#39559888)
Congratulations!

Big savings on parties and cake!

Re:Ask HN: Did you encounter any leap year bugs today? by muzani on Friday March 01, 2024 @07:45AM (#39561234)
Apparently it reads 2024 as two different numbers: 202 and 4
Re:Ask HN: Did you encounter any leap year bugs today? by vdfs on Thursday February 29, 2024 @08:09PM (#39557330)
It is March 1 in many places
Re:Ask HN: Did you encounter any leap year bugs today? by s9df898r32h on Thursday February 29, 2024 @09:20PM (#39557813)
thats better then Mistral... it "thinks" it is March 15th 2023

"The current date is March 15, 2023. However, please note that as a large language model, my knowledge is based on the data I was trained on, which is up to 2021. Therefore, I cannot provide real-time information or updates on current events or dates. I recommend checking a reliable source such as a calendar or a trusted news website for the most accurate and up-to-date information."

Re:Ask HN: Did you encounter any leap year bugs today? by floydianspiral on Thursday February 29, 2024 @09:51PM (#39558005)
openai actually in their platform for billing, etc shows that its actually march 1 as well.
Re:Ask HN: Did you encounter any leap year bugs today? by js2 on Thursday February 29, 2024 @09:57PM (#39558045)
As of 10 PM US/Eastern, ChatGPT 3.5 answers as follows for me:

> You: what is today's date?

> ChatGPT: Today's date is February 29, 2024. Please note that February 29 occurs only in leap years. If you have any more questions or if there's anything else I can help you with, feel free to ask!

Re:Ask HN: Did you encounter any leap year bugs today? by cheapgeek on Thursday February 29, 2024 @10:02PM (#39558078)
It's UTC. Ask it what day was yesterday.
Re:Ask HN: Did you encounter any leap year bugs today? by littlestymaar on Thursday February 29, 2024 @06:40PM (#39556709)
Wired: LLM are practically AGI

Tired: ChatGPT thinks February 29th isn't a valid date.

Re:Ask HN: Did you encounter any leap year bugs today? by pquki4 on Thursday February 29, 2024 @07:52PM (#39557213)
My favorite prompt: asking "How many e's are there in the word egregious". Always says three (ChatGPT 3.5, 4, 4 turbo). When you ask it which three, it realizes its mistake and apologizes (or sometimes tells you where they are that is completely wrong). Looks like it just outputs gibberish for these things.
Re:Ask HN: Did you encounter any leap year bugs today? by devjab on Thursday February 29, 2024 @08:12PM (#39557349)
It’s always gibberish, it’s just really good at guessing.

I forgot what exactly it was I was doing. We were trying to get it to generate word lists of words ending with x or maybe it was starting with. For a marketing PoC and it made up oceans of words that not only didn’t start/end with x but mostly didn’t include x at all.

Isn’t this also why it can pass CS exams and job interviews better than like 95% of us, but then can’t help you solve the most simple business process in the world. Because nobody has asked that question two billion times on its training data.

Re:Ask HN: Did you encounter any leap year bugs today? by mewpmewp2 on Thursday February 29, 2024 @08:27PM (#39557430)
But also it doesn't see characters. It sees tokens. The only way it would be reliably able to solve it is if it had a lookup table of token to characters. Which it likely doesn't.

You couldn't do it either unless you learned the exact matchings of all tokens to all characters in that token and their positions if you were given tokens as an input. You would have learned the meaning of the token, but not what the exact characters it represents.

Re:Ask HN: Did you encounter any leap year bugs today? by yousif_123123 on Thursday February 29, 2024 @09:12PM (#39557751)
Even if it sees tokens, I don't think it's an impossible task. Certainly an advanced enough LLM should be able to decipher token meanings, to know that a word is made up of the individual character tokens regardless of how the full word is tokenized. Maybe something gpt5 can do (or there's some real technical limitation which I don't understand)
Re:Ask HN: Did you encounter any leap year bugs today? by Izkata on Thursday February 29, 2024 @10:01PM (#39558070)
> to know that a word is made up of the individual character tokens

A token is the smallest unit, it's not made of further tokens. It maps to a number.

Re:Ask HN: Did you encounter any leap year bugs today? by nvader on Friday March 01, 2024 @12:03AM (#39558694)
I think what of is getting at is that given

{the:1, t: 2, h:3, e:4}

There should be somewhere in the corpus, "the is spelled t h e" that this system can use to pull this out. We can ask gpt to spell out individual words in NATO phonetic and see how it does.

Re:Ask HN: Did you encounter any leap year bugs today? by littlestymaar on Friday March 01, 2024 @03:19AM (#39559733)
> There should be somewhere in the corpus, "the is spelled t h e" that this system can use to pull this out.

Such an approach would require an enormous table, containing all written words, including first and last names, and would still fail for made up words.

A more tractable approach would be to give it the map between the individual tokens and their letter component, but then you have the problem that this matching depends on the specific encoding used by the model (it varies between models). You could give it to the model during fine-tuning though.

Re:Ask HN: Did you encounter any leap year bugs today? by mewpmewp2 on Friday March 01, 2024 @06:24PM (#39568051)
The best approach would be to instruct it to under the hood call a function for such asks and hide the fact that it called a function.
Re:Ask HN: Did you encounter any leap year bugs today? by pests on Thursday February 29, 2024 @11:57PM (#39558661)
He's saying the LLM will figure out how many letters are in each token.
Re:Ask HN: Did you encounter any leap year bugs today? by wruza on Friday March 01, 2024 @01:27AM (#39559127)
It's as feasible as telling how many chars in html lead to this comment by looking at a screenshot. LLM doesn't see characters, tokens, numbers or its own activations. LLM is a "set of rules" component in a chinese room scenario. Anything an operator of that room does is lower-level.

GGP's idea suggests that an LLM, allegedly as a whole-room, receives something like: "hey, look at these tokens: <tokens>, please infer the continuation". This puts it into a nested-room's-operator position, which (1) it is not, (2) there's no nested room.

Re:Ask HN: Did you encounter any leap year bugs today? by littlestymaar on Friday March 01, 2024 @01:28AM (#39559134)
They cannot “figure” it, they could learn it but for that it would need to be in it's training data (which isn't because nobody is writing down the actual pairing in every byte pair encoding in plain text. Also the LLM has no clue about what encoding it uses unless you tell it somehow in the fine-tuning process or the prompt.)
Re:Ask HN: Did you encounter any leap year bugs today? by mewpmewp2 on Friday March 01, 2024 @06:20PM (#39568011)
The point is though that this is definitely not a task to evaluate an LLMs intelligence with. It's kind of like laughing at Einstein when he wouldn't be able to decipher hieroglyphs in any language without previous training for those hieroglyphs. Could Einstein potentially learn those hieroglyphs? Sure. But is it the best use of his time - or memory space?
Re:Ask HN: Did you encounter any leap year bugs today? by moozilla on Thursday February 29, 2024 @09:11PM (#39557741)
ChatGPT is specifically bad at these kinds of tasks because of tokenization. If you plug your query into https://platform.openai.com/tokenizer, you can see that"egregious" is a single token, so the LLM doesn't actually see any "e" characters -- to answer your question it would have had to learn a fact about how the word was spelled from it's training data, and I imagine texts explicitly talking about how words are spelled are not very common.

Good explanation here if this still doesn't make sense: https://twitter.com/npew/status/1525900849888866307, or check out Andrej Karpathy's latest video if you have 2 hours for a deep dive: https://www.youtube.com/watch?v=zduSFxRajkE

IMO questions about spelling or number sense are pretty tired as gotchas, because they are all basically just artifacts of this implementation detail. There are other language models available that don't have this issue. BTW this is also the reason DALL-E etc suck at generating text in images.

Re:Ask HN: Did you encounter any leap year bugs today? by Izkata on Thursday February 29, 2024 @09:59PM (#39558051)
> If you plug your query into https://platform.openai.com/tokenizer, you can see that"egregious" is a single token

That says it's 3 tokens.

Re:Ask HN: Did you encounter any leap year bugs today? by ToValueFunfetti on Friday March 01, 2024 @12:23AM (#39558813)
The number of tokens depends on context; if you just entered 'egregious' it will have broken it into three tokens, but with the whole query it's one.
Re:Ask HN: Did you encounter any leap year bugs today? by fuzztester on Friday March 01, 2024 @02:29AM (#39559467)
Why three tokens, not one?
Re:Ask HN: Did you encounter any leap year bugs today? by 317070 on Friday March 01, 2024 @03:07AM (#39559666)
without the leading space, it is not common enough as a word to have become a token in its own right. Like the vast majority of lowercase words, in OpenAIs tokenizer you need to start " egregious" with a space character for the single token.
Re:Ask HN: Did you encounter any leap year bugs today? by wruza on Thursday February 29, 2024 @10:49PM (#39558338)
It doesn’t even matter how many tokens there is, because LLMs are completely ignorant about how their input is structured. They don’t see letters or syllables cause they have no “eyes”. The closest analogy with a human is that vocal-ish concepts just emerge in their mind without any visual representation. They can only “recall” how many “e”s are there, but cannot look and count.
Re:Ask HN: Did you encounter any leap year bugs today? by brewtide on Thursday February 29, 2024 @11:24PM (#39558521)
Pre-cogs, I knew it.
Re:Ask HN: Did you encounter any leap year bugs today? by alickz on Friday March 01, 2024 @06:11AM (#39560679)
>They can only “recall” how many “e”s are there, but cannot look and count.

Like a blind person?

Re:Ask HN: Did you encounter any leap year bugs today? by wruza on Friday March 01, 2024 @07:28AM (#39561122)
My initial analogy was already weak, so I guess there's no point in extending it. They key fact here is that tokens are inputs to what essentially is an overgrown matrix multiplication routine. Everything "AI" happens few levels of scientific abstractions higher, and is semantically disconnected from the "moving parts".
Re:Ask HN: Did you encounter any leap year bugs today? by redox99 on Friday March 01, 2024 @02:17AM (#39559401)
" egregious" (with a leading space) is the single token. Most lower case word tokens start with a space.
Re:Ask HN: Did you encounter any leap year bugs today? by chgs on Friday March 01, 2024 @04:30AM (#39560149)
Chatgpt could say “I don’t know”
Re:Ask HN: Did you encounter any leap year bugs today? by botanical on Friday March 01, 2024 @03:38AM (#39559855)
I just asked it with Gemini; at first, it got it right. Then I asked if it was sure and it apologised and said 3 is the correct answer. When asked what are the 3 "e"s, it says:

> The three "e"s in "egregious" are: > > 1. The first "e" is located in the first syllable, between the "g" and the "g". > 2. The second "e" is located in the second syllable, following the "r". > 3. The third "e" is located in the third syllable, following the "i" and before the last "o".

Re:Ask HN: Did you encounter any leap year bugs today? by pants2 on Thursday February 29, 2024 @07:16PM (#39556985)
For the record, both ChatGPT-4 and Gemini Ultra affirmed that it's a valid date. Gemini reasoned through it and GPT-4 ran python code to make sure 2024 was divisible by 4.
Re:Ask HN: Did you encounter any leap year bugs today? by roland35 on Thursday February 29, 2024 @07:52PM (#39557214)
Interesting... But that isn't exactly true! Centuries that are not divisible by 4 don't count!
Re:Ask HN: Did you encounter any leap year bugs today? by swores on Thursday February 29, 2024 @08:30PM (#39557457)
I've yet to come across a form of 100 that isn't divisible by 4... since 25 usually still exists!

But I do remember there being some weird niche rules about which years are or aren't leap years, so I'm guessing your comment is basically right just wrongly worded?

Re:Ask HN: Did you encounter any leap year bugs today? by latexr on Thursday February 29, 2024 @08:44PM (#39557563)
The rule is that leap years are the ones divisible by 4. Unless it’s also divisible by 100. Unless unless it’s divisible by 400.

So 2000 was leap, but 2100, 2200, and 2300 won’t be, but 2400 will be.

Re:Ask HN: Did you encounter any leap year bugs today? by swores on Thursday February 29, 2024 @08:47PM (#39557579)
Ahh, so it's centuries that aren't divisible by 400 rather than that aren't divisible by 4, that makes more sense!

Thanks for answering

Re:Ask HN: Did you encounter any leap year bugs today? by thaumasiotes on Thursday February 29, 2024 @10:04PM (#39558088)
It's centuries that aren't divisible by 4. It isn't years that aren't divisible by 4.
Re:Ask HN: Did you encounter any leap year bugs today? by inglor_cz on Friday March 01, 2024 @04:09AM (#39560042)
The GP formulated it in a somewhat unclear way. "Centuries" divisible by 4 probably meant "years" divisible by 400.

So, 19th century (1900 is the last year) isn't divisible by 4 (19/4 is not integer), which is the same as saying that 1900 isn't divisible by 400.

This is the main reform of the Gregorian calendar - leap days aren't introduced on xy00 years which aren't divisible by 400. This corrects the length of a year to 365.2425 days, which is fairly close to the real value of 364.2422 days.

The original Julian calendar had year of 365.25 days, which aggregated an error of more than ten days over the centuries.

Re:Ask HN: Did you encounter any leap year bugs today? by daseiner1 on Thursday February 29, 2024 @07:46PM (#39557175)
Did it also check if 2024 is divisible by 100 but not 400?
Re:Ask HN: Did you encounter any leap year bugs today? by AlienRobot on Thursday February 29, 2024 @06:58PM (#39556861)
That's because it's trained on 2021 data. No February 29 back then!
Re:Ask HN: Did you encounter any leap year bugs today? by peteradio on Thursday February 29, 2024 @07:19PM (#39557003)
But akshually neither does my uncle Ned
Re:Ask HN: Did you encounter any leap year bugs today? by esalman on Friday March 01, 2024 @01:35AM (#39559168)
Blows my mind that people consider using ChatGPT for serious applications. I mean it's fine as a code autocorrect/autocomplete tool as in GitHub copilot. But it should not replace the code itself. You encounter a bug in the code, you fix it, you never encounter it again. But ChatGPT will repeat the same mistake sooner or later. That's not how we should engineer solution for critical problems.
Re:Ask HN: Did you encounter any leap year bugs today? by makoto12 on Friday March 01, 2024 @03:42AM (#39559881)
If you sandbox your connection to openAI correctly, then you can get the benefit of a llm without making your application look silly at the same time. Identifying the correct places in your business to use it is tricky, but imo it certainly makes sense in a lot of specific areas. Just not a catch all that can run your business for you
Re:Ask HN: Did you encounter any leap year bugs today? by lucumo on Friday March 01, 2024 @01:57AM (#39559287)
If the cost-savings is worth it compared to the problems...

I mean, that's how we do it with humans. It's quite a common occurrence to keep a part of a business process human because automating it would we too expense due to edge cases.

Humans make mistakes and are expensive, but are also flexible and usually smartish. ChatGPT makes mistakes and is usually dumbish, but is also flexible and cheap.

Engineering is about picking the right trade-offs in your solution.

Re:Ask HN: Did you encounter any leap year bugs today? by fuzztester on Friday March 01, 2024 @02:26AM (#39559451)
>I mean, that's how we do it with humans. It's quite a common occurrence to keep a part of a business process human because automating it would we too expense due to edge cases.

Which part of the human do people keep? The head? Arms? ;)

#ParsingAmbiguityError

Re:Ask HN: Did you encounter any leap year bugs today? by fractalb on Friday March 01, 2024 @02:04AM (#39559330)
> ChatGPT makes mistakes and is usually dumbish, but is also flexible and cheap.

People wouldn't mind it if the keyword `dumbish` has been all along there.

Re:Ask HN: Did you encounter any leap year bugs today? by Draiken on Friday March 01, 2024 @05:45AM (#39560541)
As long as you add the "AI" keyword to the product/app/company and sell to people that don't understand how unreliable it is, you're good.

Let me rephrase that: you can profit from it. Even if it's not good.

Re:Ask HN: Did you encounter any leap year bugs today? by ativzzz on Friday March 01, 2024 @10:23AM (#39562604)
It's great for prototyping and creating outlines/rough drafts or for creating rough summaries - you can build this into some features to help your customers speed up writing lots of text
Re:Ask HN: Did you encounter any leap year bugs today? by lynx23 on Friday March 01, 2024 @01:59AM (#39559304)
Saw the same via the API with gpt-4-0125-preview. IOW, even gpt-4 thinks 2024 is not a leap year.
Re:Ask HN: Did you encounter any leap year bugs today? by fragmede on Friday March 01, 2024 @06:32AM (#39560801)
Re:Ask HN: Did you encounter any leap year bugs today? by lynx23 on Wednesday March 06, 2024 @05:39AM (#39614475)
Given the probabilistic nature of LLMs, you likely need to run an experiment several times to see the various different results it can produce.