Live data from Hacker News

ChatML: ChatGPT API expects a structured format, called Chat Markup Language

github.com

41–50 of 83 posts

Re: ChatML: ChatGPT API expects a structured format, called Chat Markup Language

#42
Do you have to prefix every user query with a long list of examples to create context (and be billed for it extra for every query)?

Or there is a way to create context with some prelude and then use it for subsequent queries?

Let's say I want to create quick help for SQL, where the prelude would be schema snapshot and some examples.

Do I need to flood every user query with this long prefix of sql schema snapshot with examples?

I don't want one user conversatio to interfere with other user query.

Re: ChatML: ChatGPT API expects a structured format, called Chat Markup Language

#43

Do you have to prefix every user query with a long list of examples to create context (and be billed for it extra for every query)? Or there is a way to create context with some prelude and then use it for subsequent queries? Let's say I want to create quick help for SQL, where the prelude would be schema snapshot and some examples. Do I need to flood every user query with this long prefix of sql schema snapshot with…

Check out fine tuning docs: https://platform.openai.com/docs/guides/fine-tuning

Re: ChatML: ChatGPT API expects a structured format, called Chat Markup Language

#45
post #43

Do you have to prefix every user query with a long list of examples to create context (and be billed for it extra for every query)? Or there is a way to create context with some prelude and then use it for subsequent queries? Let's say I want to create quick help for SQL, where the prelude would be schema snapshot and some examples. Do I need to flood every user query with this long prefix of sql schema snapshot with…

Check out fine tuning docs: https://platform.openai.com/docs/guides/fine-tuning

no fine tuning for gpt-3.5-turbo

Re: ChatML: ChatGPT API expects a structured format, called Chat Markup Language

#46
post #4

(I work at OpenAI.) This document is a preview of the underlying format consumed by ChatGPT models. As an API user, today you use our higher-level API ( https://platform.openai.com/docs/guides/chat ). We'll be opening up direct access to this format in the future, and want to give people visibility into what's going on under the hood in the meanwhile!

There doesn't seem to be any way to protect against prompt injection attacks against [system], since [system] isn't a separate token. I understand this is a preview, but if there's one takeaway from the history of cybersecurity attacks, it's this: please put some thought into how queries are escaped. SQL injection attacks plagued the industry for decades precisely because the initial format didn't think through how t…

> SQL injection attacks plagued the industry for decades precisely because the initial format didn't think through how to escape queries.

No. SQL injection vulnerabilities plagued the industry for decades, as opposed to months/years, because developers thought they can take input in one format, "escape" it enough, sprinkle with addslashes and things will work. And apparently we still teach this even when we have decades of experience that escaping does not work. XSS is just a different side of the same coin - pretending that one can simply pipe strings between languages.

You have to speak the language. Good luck getting LLM to respond to tokens deterministically. On top of escaping being a flaky solution in itself you now have an engine that is flaky in parsing escapes.

Re: ChatML: ChatGPT API expects a structured format, called Chat Markup Language

#47
post #31

Earlier quoted context omitted.

I'd argue, they aren't doing something future-proof right now because the fundamental architecture of the LLM makes it nearly impossible to guarantee the model will correctly respond event to special [system] tokens. In your SQL example, the interpreter can deterministically distinguish between "instruct" and "data" (assuming proper escape obviously). In the LLM sense, you can only train the model to pick up on speci…

You can't (??) make the LLM treat a token deterministically, at least not in my understanding of the current architectures. I believe that's the case and, well, there are some problems there. Specifically, it may be an API but the magic happens with this token response, which is nondeterministic and no controllable, as commentator sillysaurusx notes. IE, you're saying "they're doing anything like security 'cause they…

Not that I can think of an implementation off the top of my head, but there's gotta be non-ai ways to sanitize input before it even hits the model.

perhaps I'm just showing my ignorance if the problem space...

Re: ChatML: ChatGPT API expects a structured format, called Chat Markup Language

#49

Earlier quoted context omitted.

You can't (??) make the LLM treat a token deterministically, at least not in my understanding of the current architectures. I believe that's the case and, well, there are some problems there. Specifically, it may be an API but the magic happens with this token response, which is nondeterministic and no controllable, as commentator sillysaurusx notes. IE, you're saying "they're doing anything like security 'cause they…

Not that I can think of an implementation off the top of my head, but there's gotta be non-ai ways to sanitize input before it even hits the model. perhaps I'm just showing my ignorance if the problem space...

The issue is that even after you sanitize the instructions from the data, you have to put it back into one text blob to feed to the LLM. So any sanitization you do will be undone.
Post reply on HN