Infinite AI Array
ianbicking.org
ianbicking.org
Horrible idea. Great execution.
I suspect our intuition tells us code will be verified first by a programmer, then by the language parser, whereas data is likely to be manipulated without human scrutiny.
Does anyone seriously believe that this will forever be the case?
That's a problem, because it that is what it is.
Read the readme...
First it was against Perl developers (well I actually also knew a few C programmers who looked down on "C++ lamers" but not sure if it was widespread), then PHP, then JS and apparently now Python. I think we should stop feeding the stereotypes.
https://www.destroyallsoftware.com/talks/the-birth-and-death...
Less sarcastic quote: Anything that can be Written in JavaScript, will Eventually be Written in JavaScript.
im calling you out because you have no idea of what youre speaking of ;; youve been an HN member since 2018 ; Ive had mined since 2009, but even before that....
i agree with 100.
growing up in the 80s and reading cyberpunk fiction??
I think we should blame those dudes on CONSEQUENCES of
WHAT IF
CEO, 20 years later: Inspired by "Don't Build The Cyberpunk Dystopian Hellscape", we have built a Cyberpunk Dystopian Hellscape! It will be very profitable.
But I don’t think this joke works because afaik it’s a reference to: https://hitchhikers.fandom.com/wiki/Total_Perspective_Vortex
And in the book it didn’t work because Zaphod was (rightfully) so egotistical he was immune to it! So it seems the sci-fi author’s moral here is that it’s fine actually.
Zaphod glared at him with resentment and loathing.
"What's the difference?" he muttered.
"Nothing," said Zarniwoop, "they are identical. Oh-except that I think the Frogstar Fighters are grey in the real Universe."
...
"Meanwhile, you and I arranged that you would steal the Improbability Drive ship-the only one which could reach the ruler's world-and bring it to me here. This you have now done I trust, and I congratulate you." He smiled a tight little smile which Zaphod wanted to hit with a brick.
"Oh, and in case you were wondering," added Zarniwoop, "this Universe was created specifically for you to come to. You are therefore the most important person in this Universe. You would never," he said with an even more brickable smile, "have survived the Total Perspective Vortex in the real one. Shall we go?"
What is a (great) joke now might be less of a joke 5-10 years from now. :)
This makes it a lot harder to rely on OpenAI's API if you are doing any sort of caching / evaluation workloads.
My guess is that promising it right now is not a priority. It would be a great "pro" or "enterprise" type feature tho.
It is strange that cub does not guarantee determinism here - it's not too hard an op to implement in CUDA.
Tensorflow is non-deterministic for some operations due to thread scheduling. PyTorch doesn’t have this issue.
The source code shows that it's using pickling to store OpenAI responses on the local filesystem. See here:
https://github.com/ianb/infinite-ai-array/blob/main/iaia/gpt...
and here:
https://github.com/ianb/infinite-ai-array/blob/main/iaia/gpt...
If it was JSON then it wouldn't be crazy to add it to your repository. (I guess Pickle is stable enough in practice, but it would offend my personal sensibilities to check them in.)
I can't imagine it's too hard to serialize the `existing` python dict so subsequent runs are deterministic
The problem* is that if a prompt changes slightly then it won't be a cache hit.
* okay, one problem.
[0]: https://github.com/MythicManiac/copilot-import [1]: https://github.com/drathier/stack-overflow-import
We're all about to get some real-world GAN training.
Give me a list of imaginary products that might be found in a magic shop formatted as json array including an id name, description, sku, price. Use syntax highlighting for the output and pretty print it. {
"id": 2,
"name": "Magic Wand",
"description": "A magical wand that can cast powerful spells.",
"sku": "MAGIC-WAND-001",
"price": 49.99
},
Is instead: {
"id": 4,
"name": "Magic Wand",
"description": "A powerful wand made from a magical tree.",
"sku": "MAGIC-WAND-001",
"price": 1500.00
}
Or with "fancy", it is — {
"id": 3,
"name": "Mystic Wand",
"description": "A powerful wand that grants the wielder the ability to cast powerful spells.",
"sku": "WAND-001",
"price": "199.99"
},
And if the magic shop is "run down", it might have — {
"id": 3,
"name": "Mystical Wand",
"description": "A powerful wand that grants the wielder the ability to cast spells.",
"sku": "WAND-001",
"price": 29.99
}
What a joy :)Edit: just RTFA'd, yeah this is better. What happens if you call magic.ai_take_over_world_debug_until_no_exceptions()?
(Obligatory, in the comments from a decade ago: "They shut down Google Dictionary recently and now this set tool. What's next, Google? Gmail, perhaps?")
Disclosure: I work at Google, on Sheets many years ago.
https://ianbicking.org/events-and-sqlobject.html
https://ianbicking.org/archive/sqlobject-and-me.html
https://en.wikipedia.org/wiki/SQLObject
Edit: In case you have "show dead" enabled, I'd like to add that smohare has no fucking clue what he's shit talking about, but by looking at his dead downvoted posting history and useless comments and worthless opinions, to be jealously insulted by him is the highest complement.
Do those objects... know the names of the variables they are assigned to?
foo = 4
print(f"{foo=}".split("=")[0])I would imagine that I just state comments in my code file. Then, at runtime, all code is produced by the language model, and then executed.
There's the issue of the model producing different generative results with each execution. But maybe that could be taken care off by adding doctests within my comments. Which could, of course, be mostly generated by another language model...
An awful lot of chip fabrication is done via stochastic / heuristic / monte carlo methods for any large chip; rather than exhaustively laying out the whole chip by hand, hardware devs describe the chip in a constraints language and feed it to a fabrication program (often with some additional parameters like "optimize speed" or "minimize power consumption / heat generation"). Then the program outputs the chip schematic to be fabricated.
Unless you save the random seed at every step, it's entirely possible to end up with the problem that you have a schematic, but if you lose it you'll never get the program to fabricate exactly that schematic again (because hundreds or thousands of precise schematics solve the problem well enough to terminate the monte carlo search).
To make fun of this behavior, I made a similar thing for javascript when proxies came into the language https://github.com/Matsemann/Declaraoids
What I'm finding it's extremely great for is writing drivel. I'm talking ecommerce product descriptions, product names, copy... it's really awesome for making one of my side gigs less of a chore.
(Forgot to actually look it up... seems like it does exist but shouldn't, as it's an empty placeholder: https://pypi.org/project/gpt3/)
I was pretty surprised playing around with github copilot that it could understand the context of a CSV file and filled in all the headers and stuff when I asked it to, then I realized it could probably just arbitrarily read anything on my computer and promptly uninstalled it.
Yeah you have a point. It does boldly claim that it's good at code, though I find a lot more utility just searching github and gists.
Just ask GPT-3 for the code in the library, what's the problem?
/s
Boom, it clones the fake library. cd slack-bot-template, cat main.py and away you go.
{Modify the project to do X and commit}
Etc etc.
getRandomNumber() {
return 4; // chosen by fair dice roll
// guaranteed to be random
};> This code snippet appears to be a joke because it is claiming to be a function that returns a random number, but the function always returns the number 4. The line "chosen by fair dice roll / guaranteed to be random" is a reference to the common phrase "random as a dice roll," which means something is truly random and unpredictable. However, the fact that the function always returns 4 suggests that it is not actually random at all.
> The joke in this code is that the function is called "getRandomNumber", but it always returns the number 4, which is not random at all. The comment "chosen by fair dice roll" and "guaranteed to be random" are added for humorous effect, because they suggest that the number 4 was chosen through a random process, but in reality it is hardcoded into the function. The joke is meant to be a play on the idea of "randomness", implying that the function is not actually generating a random number as it claims to do.
class InfiniteArray: def __init__(self, generator_function): self.generator_function = generator_function self.items = [] self.index = 0
def __getitem__(self, index):
# if the index is out of bounds, generate more items
while index >= len(self.items):
self.items.append(self.generator_function())
return self.items[index]
# example generator function that generates capital cities
def world_capital_cities():
# list of capital cities
capital_cities = ['Paris', 'London', 'Tokyo', 'New Delhi', 'Beijing']
# generate capital cities in a cyclic manner
for i in itertools.cycle(range(len(capital_cities))):
yield capital_cities[i]# create an infinite array object with the world_capital_cities generator function capital_cities_array = InfiniteArray(world_capital_cities)
# access the 10th item in the array print(capital_cities_array[10]) # prints 'New Delhi'
# example generator function that generates concatenation of two lists def soft_sweet(): # list of soft items soft = ['cloud', 'pillow', 'fluffy'] # list of sweet items sweet = ['ice cream', 'candy', 'bunny'] # generate concatenation of soft and sweet in a cyclic manner for i in itertools.cycle(range(len(soft))): yield soft[i] + ' ' + sweet[i]
# create an infinite array object with the soft_sweet generator function soft_sweet_array = InfiniteArray(soft_sweet)
# access the 5th item in the array print(soft_sweet_array[5]) # prints 'pillow candy'
Note that this implementation is just an example and may not be suitable for all use cases. For example, it does not handle negative indices or slice operations. You may need to modify the implementation to suit your specific needs.
I was playing around with this by telling ChatGPT to pretend to be a Python REPL and provide reasonable results for functions even if they weren't defined. A few of my favorite results:
>>> sentence_transform("I went to the bank yesterday.", tense="future")
"I will go to the bank tomorrow."
>>> wittiest_comeback(to_quip="Hey George, the ocean called. They're running out of shrimp.", funny=True)
"Well, I hope it's not too crabby about it."
>>> sort_by_temperature(["sun", "ice cube", "flamin-hot cheetos", "tea", "coffee", "winter day", "summer day"], reverse=True)
["flamin-hot cheetos", "sun", "tea", "coffee", "summer day", "winter day", "ice cube"]
It took some experimenting to get it to consistently respond as expected. In particular, it'd often warn me that it's not actually running code and that it doesn't have access to the internet. Explicitly telling it to respond despite those things helped. Here's the latest version of the prompt I've had success with:---
Your task is to simulate an interpreter for the Python programming language. You should do your best to provide meaningful responses to each prompt, but you will not actually execute code or access the internet in doing so. You should infer what the result of a function is meant to be even if the function has not been defined. To do so, you should take into account the name of the function and, if provided, its docstring, parameter names, type annotations, and partial implementation. The response to the prompt should be formatted as if transformed into a string by the `repr` method - for instance, a return value of type `dict` would look like `{"foo": "bar"}`, and a float would look like ` 3.14`. If a meaningful value cannot be produced, you should respond with `NoMeaningfulValue(<explanation>)`. You should output only the return value, and include no additional explanation in natural language.
---
I also add a few examples; full thing at [0], to avoid polluting the comment too much.
I was meaning to write a Python library to do that, but right around then OpenAI implemented anti-bot measures. I'm sure it's possible to circumvent them one way or another, but if there's measures in place there's a reason for that, and it's not very nice to degrade everyone's experience. I've had less impressive results with codex-2 so far. Still, harnessing hallucination is a pretty cool idea.
[0] https://gist.github.com/pedrovhb/2ac9b93f446f91a2be234622309...
It feels like the current AI developments ( OpenAI, SD, etc) are just like wheels. We are now putting them on a cart and invent transportation.
And look, we are planning to go to Mars.
So rather than programming in every airline (and array of airline names) for a program that returns airline names, it queries ChatGPT for airline names.
If I'm wrong I am sure someone here will be quick to correct me and provide the right answer.
For something like the book example I expect once you get to item 12 it might repeat item 0 since that won't be included in the examples.
primes = InfiniteAIArray()
Is the context determined from the variable name? If so is this through a kind of reflection?