News for hackers. Stuff that matters.
Re:Show HN: LLMs can generate valid JSON 100% of the time by andreygrehov on Monday August 14, 2023 @10:54PM (#37129631)
Meh... I asked GPT4 to return a sample PHP code inside of a random JSON. It failed the JSON linter from the very first try. I actually couldn't pass the validation despite many retries, eg follow up corrections. Not a single time it generated a 100% valid JSON, I eventually gave up.
Re:Show HN: LLMs can generate valid JSON 100% of the time by ipaddr on Tuesday August 15, 2023 @02:00AM (#37130717)
This worked with chatGPT: create a sample hello world in php

store that code in a json[object

code: { "php_code": "<?php echo 'Hello, World!'; ?>" }

Re:Show HN: LLMs can generate valid JSON 100% of the time by adamrezich on Tuesday August 15, 2023 @04:29AM (#37131505)
if you think that's bad, try to get it to generate Inform 7 games—Inform's natural-English-ish syntax completely throws all LLMs for a loop, consistently. it generates code that looks possibly correct (to an Inform newbie at least), but fails to compile far more often than not. I find this super interesting.