7 ms·
Is-even-ai – Check if a number is even using the power of AI
- vunderba 1y agoPerhaps I should file an issue to increase the accuracy by including a RAG database in LanceDB with embeddings for the set of even numbers up to 32-bits.
- elif 1y agoFeeding that into your prompt will increase the token costs
- parpfish 1y agoUse this to add AI to your product to appease management. Next week, “refactor” it out and brag to manager about cost savings and performance boosts, don’t mention “removing the AI”.
- lrvick 1y agoNPM packages can never be removed once added to a codebase. You can only add more.
- freetime2 1y agoBoss: What have you been working on for the last quarter? Me: I leveraged Deep Intelligence to build a Next-Gen Parity Classifier with 99.9% accuracy.
- rthnbgrredf 1y agoSmart Boss: And what did you actually do?
- joshka 1y agoCan we get a leftpad-ai please?
- fooker 1y agoAhem secure-left-ai-405b-quantized.
- mrits 1y agoThis works great for situations where you can’t trust traditional intelligence. Thank you for your contribution
- sodra9000 1y agoThis package should be updated to use the newer gpt-4o-mini model, rather than gpt-3.5-turbo. Its 3x cheaper, twice as fast, and supports cached input just in case you need to double check if the last number you entered was even. It also has a knowledge cutoff of September 30 2023, which helps for any newly discovered even numbers since gpt-3.5s launch!
- jeron 1y agowhy stop there? let's get an is-true-ai that checks if a boolean is true using AI
- jsheard 1y ago@grok is this truthy?
- VladVladikoff 1y agoFalse
- hnburnsy 1y agoFound the Grok imposter, Grok would give a three paragraph answer.
- danillonunes 1y agoFalse, but you know what is true? White genocide!
- atum47 1y agoI remember when the whole isEven package was ridiculed for the first time a while ago, back then I thought about training a NN to predict the odds of a number being even, as a joke. I don't actually remember if I actually wrote code for it, but in the end I thought no one would laugh and gave up
- ksherlock 1y agoWhen I watched Andrej Karpathy's NN videos a year or two back, I trained a Neural Network to multiply an integer by two. This was with a rather small training set but if you rounded the results (which was a floating point), they were mostly correct. For positive numbers. My training data didn't include any negative numbers so they were hilariously bad.
- ukuina 1y agoThis doesn't work if I use a reasoning model like o3, which does not allow setting max_tokens. Without reasoning, how can I be SURE a number is even?
- hartator 1y agoMultiple models?
- parpfish 1y agoI think before you would deploy this to prod, you should wrap it with a few guardrails to make sure it’s not hallucinating. Pretty simple — just take the output from the llm and see if it agrees with a simple mod2 operation. Of it agrees, return model output to the user. Otherwise do a couple of retries with different prompts.
- mrheosuper 1y agomod2 is outdated and has not been updated for years, nobody uses it anymore
- s1mplicissimus 1y agoThis package has saved me so many hours of tedious gruntwork. It's like a junior developer - you still have to manually check their work, but when it's correct, it's a great productivity improvement. And don't forget where this will go in a couple years with improved models and more computing power, it's gonna be awesome! [/i]
- darepublic 1y agopro tip: play around with the temperature especially when using big numbers as input
- hzambo 1y agoWow, amazing tip. This hack improved my workflow by 10x.
- Waterluvian 1y agoOnly 9x for me. What am I doing wrong? Can you share your vscode colour scheme file?
- floren 1y agoWhat model were you using? You need to use gpt-3.14-tastesgreat-lessfilling, I've used it to write 130 side hustle projects this month with only prompting.
- bigbuppo 1y agoVibe coding your way to greatness. Wish I could do that, but it seems too hard becoming a prompt engineer. Stringing together words? That's why we have AI!
- koakuma-chan 1y agoAre there actually still Junior Developers out there? I thought no one is hiring Junior Developers.
- adzm 1y agoHonestly this should take string input as well. Finally I could find out if a Unicode duck or the word "syzygy" are even!
- jasonjmcghee 1y agoYou might be able to optimize this by using embeddings. Store all the numbers and search "odd" and "even" until you find your number.
- asidiali 1y agoThis hit way too close to home, I’m cackling.
- snorkel 1y agoLacks an isVeryEven() method, otherwise looks feature complete.
- agentdax5 1y agoI’m waiting for them to add the isEvenSteven() method. Then I can integrate this with my escrow smart contract.
- crazysim 1y agoHow reliable is this? I'm half joking too but I wouldn't mind reading a report comparing this on OpenAI and various other LLMs. Somehow I doubt it'll be 100%... right?
- est 1y agoits as accurate as how Tiktokenizer deal with numeral characters
- geor9e 1y agonormally llms are pretty bad at math, but in this case it should just look at the final digit and map 10 values which I can't imagine going wrong
- crazysim 1y agoI'm just curious how _low_ can you go before it does go wrong.
- bigbuppo 1y agoI mean if this were a check for primes the answer would be 1.
- daemonologist 1y agoThe tokenizer might lump the last digit together with some preceding digits though. I know o200k_base (OpenAI -o models) tends to give groups of three (900001 for example is 900-001). Anyway, I wouldn't be surprised if a non-finetuned model made some mistakes.
- timewizard 1y agois 0x2a even?
- gruez 1y agoI tried with this on chatgpt.com (anonymous) and it was wrong: >You are an AI assistant designed to answer questions about numbers. You will only answer with only the word true or false. >Is 393330370227914821469106615363204944758938252979261537157082994586230072180858944545028761701928694832864623009988147774229437650643225379825905427239525512110359581021414640894111281701792224552922491447051506246553646282117414112976459608594044929244664050172002138933343230226871897567 an even number? response: >True The prompt was the same used as the library: https://github.com/Calvin-LL/is-even-ai/blob/b00dbfcbb89a197ff8a476fb6ba44b23c5361443/src/IsEvenAiOpenAi.ts#L4-L14 https://github.com/Calvin-LL/is-even-ai/blob/b00dbfcbb89a197...
- jameslk 1y ago60% of the time, it works every time
- joshdavham 1y agoI’m glad you included an isOdd() method. I was about to ask how you’d check for that.
- daft_pink 1y agoVenture capitalist here… how can I invest?
- bigbuppo 1y agoFinally, a reason to use AI.
- deleted 1y ago[deleted]
- iamthemonster 1y agoThis is pretty useless to be honest. It's good for telling whether a number is even, but in our industry we need more powerful functionality. We also need to know whether a number is odd.
- charles_f 1y agoRTFM, it's not only implementing isOdd but also a large set of rarely used advance operations such as isEqual, or isGreaterThan Trully AI is astonishing
- avandekleut 1y agoSomeone should implement this using tool calls.
- YokoZar 1y agoGreat news! The package includes an isOdd function as well!
- nbittich 1y agoisn't it breaking the one package one responsibility principle?uncle bob wouldn't be happy, it doesn't seem clean
- whynotmaybe 1y agoWhy a specific function ? With a few lines of code, you can just create a list with all the numbers that are even and when you need to check if a number is odd, you simply have to check if it's in the list.
- ashton314 1y ago…but there’s only one dependency!! This goes against the NPM ethos of importing anything and everything that you might be tempted to just handle yourself. I’ll be waiting for the Enterprise Version that uses the appropriate number of dependencies.
- deleted 1y ago[deleted]
- jaza 1y agoGreat that this is a library. Really need this as a SaaS too. iseven.ai anyone?
- alluro2 1y agoWith this amount of innovation and market fit, I see $2B evaluation in ~3 months EASILY. Exit to one of the large players for $3B.
- mitthrowaway2 1y agoIs there a version I can run locally? I don't want OpenAI training on my integers.
- avs733 1y agoyou need the roomHeater fork. It uses the Climate Change 1.5C license
- bosky101 1y agoRofl
- johnisgood 1y agoWhy? Do you have anything to hide?[1]. [1] https://en.wikipedia.org/wiki/Illegal_number https://en.wikipedia.org/wiki/Illegal_number
- Asilvorcarp 1y agoBoss: replace all ancient assembly opcodes with AI-powered ones!
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]
- yalogin 1y agoOn a similar note, I was testing LLM's code writing ability and asked Qwen to write me a model to reverse a numerical string. It gave me code and instructions to compile and run. However it had errors in it and after few attempts asking it to fix it, I was able to compile and run. But, alas, the code just kept failing and generated hubris. I gave up. Not to pick on Qwen. I actually like it much better than chatGPT. I have seen Qwen give correct responses when chatGPT lied and gave me wrong information for the exact same question.
- lrvick 1y agoThe sad reality is every large production NPM codebase will rely on this within 5 years, just like is-even.
- cobbzilla 1y agoThis still does actual work. Where are echo-ai and cat-ai?
- alexitosrv 1y agoThis is the best chain of comments in a HN thread in a long time. Happy to see the hacker spirit strong!
- kevinventullo 1y agoThis is never going to scale. Eventually we’re going to run out of numbers which have been manually checked for evenness by a human, and instead the training data for the checks will be polluted by numbers which have only been verified by computers.
- jwillp 1y agoTraining computers on human stupidity has got to be infinitely scalable, by induction.
- lucaspfeifer 1y agoGreat, now can you make an AI-powered type checker? I wish to expel those pesky types, which too often seem to exist only to clutter my otherwise pristine code. :)
- tetrisgm 1y agoDoes it also check types to make sure I typed 5 as an int and not a string? Hopefully the ai can solve that
- spacechild1 1y agoWhen do we get the AI powered upgrade of https://github.com/mitsuhiko/is-jonschlinkert https://github.com/mitsuhiko/is-jonschlinkert?
- fred_is_fred 1y agoI saw a Grok fork of this but it's using 88 and 14 as the only examples for some reason.
- alluro2 1y agoIt would be great if it could also save results to a blockchain. Immutability. IYKYK. With a layer of smart contracts, dApp on top, this thing could be mooning. When Lambo? In days.
- rixed 1y agoit doesn't say if it's implemented in rust i had to click on the link to find out please future hn posters start every submission also with an exemple so i can see if i like the syntax
- xarope 1y agosoftware engineering at its finest, using the power of 10,000* GPU cycles to determine one of mankind's toughest questions. * I might be off by several magnitudes too low
- io84 1y agoKudos to the open source contributors but honestly this is the kind of area where the big commercial players need to step up and help with the heavy lifting.
- HocusLocus 1y agof(): To test if n is even return the value of f(n-2). Special cases for zero and one. Recursion for the win.
- azhenley 1y agoYou should try Mirror. The LLM-powered programming-by-example programming language I made: signature is_even(x: number) -> bool example is_even(0) -> true example is_even(1) -> false example is_even(222) -> true example is_even(-99) -> false It will take your examples and "compile" to a callable function. You can read more or try it out: https://austinhenley.com/blog/mirrorlang.html https://austinhenley.com/blog/mirrorlang.html
- brundolf 1y agoAmazing, no notes
- ivape 1y agoI don't understand why everyone is making fun of this. This is how math is seriously going to be done soon enough.
- otabdeveloper4 1y agoNo, it seriously won't. LLM's are useless for math, they can't into rigorous proofs. > but my olympiad benchmarks! Those are fake. Overfitting on the test set.
- asdefghyk 1y agoIF number ends in 2,4,6,8,0 and >0 its even .....
- willmarquis 1y agoFinally, someone had the courage to disrupt the tyranny of the modulo operator. Who needs n % 2 === 0 when you can invoke a large language model and incur network latency, token limits, and API costs to answer the age-old question: is this number even? Truly, we’re living in the future.
- riwsky 1y agoI can't even. …Until now.
- downboots 1y agoIs this program even? Something about it feels very odd. [0] https://stackoverflow.com/questions/22969183/is-every-program-essentially-just-a-really-big-number https://stackoverflow.com/questions/22969183/is-every-progra...
- bosky101 1y agoSorry for the offtopic post, but I am looking to hire someone with 10 years of experience with is-even-ai. Urgent. Your first unpaid assignment will be to help load balance a bunch of MCP servers to add and THEN check if it's even. So much to go from here! We're a single threaded GPU first identity operator company with a lot history of returning the same thing. We're now expanding to combine and add multiple things. In 6 months of SOTA fine tuning we can already add upto 3 numbers. An MCP first. With temperature 1 we even add random numbers. An industry first. And we're just getting started. Join us. We're adding to our team!
- 66yatman 1y agoThis is a joke right?
- aubanel 1y agoCertainly not, it's actually possible to add 3 float32 numbers with 90% precision using AI! With a recent breakthrough, the team is working on pushing that to 10, we have enough cracked engineers to hope to make it happen soon!
- tasuki 1y agoIf I were a hiring manager and saw your comment, I wouldn't hire you. Could it have been a joke in a more obvious way? Do you think all the other comments here are serious?
- squillion 1y agoI can’t even.
- jerrygoyal 1y agothat's odd.
- debaserab2 1y agodo leftPad next!
- dmos62 1y agoAm I the only one that read this as "are you even using ai for this number?".
- ChocolateGod 1y agoThanks, I can now use this to claim my application that has absolutely nothing to do with AI is now AI powered
- rapnie 1y agoFirst we invented fire. Then along came the wheel. Countless inventions followed. Today, using the most brilliant minds of our time, the technology of billionaires, and hubris that runs thickly through our veins.. we made not just another step. We leapt head on into uncertain future. It feels odd. Are we even there?
- mmustapic 1y agoThis is so stupid, we know LLMs are not good enough for deterministic calculations. Just by running it I sometimes get that 31232198731 is even. This is why I rolled out my own version that uses my own MCP server to call bc.
- thiht 1y agoI have a few qualms with this library: 1. For an AI engineer, you can already build such a system yourself quite trivially by fine-tuning a lightweight inference model, deploying it behind a FastAPI endpoint, and orchestrating requests with a custom prompt pipeline. If you want to go further, you could even ensemble multiple LLMs for higher evenness accuracy. 2. It doesn't actually replace the modulo operator. Most people I know just use `n % 2 === 0` to check if a number is even, and they still keep that knowledge handy in case the AI service is down. This does not solve the reliability issue. 3. It does not seem very "viral" or income-generating. I know this is premature at this point, but without charging users for the library, is it reasonable to expect to make money off of this?
- nbittich 1y agoI don't think you can do 1. without distilling & quantization
- the_af 1y agoWhere I work, they are laying off all even parity engineers, to be replaced with this. They are keeping the odd parity engineers. This will achieve their goal of replacing half the staff with AI... at least I think so, I should check with is-half-ai.
- jgalt212 1y agoThe other joke package is-even has 179K weekly downloads. Is an LLM making up these numbers as well, or is this the Dead Internet at work? And if it's the Dead Internet, has the Dead Internet ever heard of caching? Maybe the Dead Internet gets a kickback from S3 egress fees. https://www.npmjs.com/package/is-even https://www.npmjs.com/package/is-even
- moritzwarhier 1y agoI don't think this isEven AI. It's a remote server running assembler, C and and CGI code, it sends your OpenAI key to the Super Intelligence to make paperclips and reaps the benefit of all the productivity increase by AI for the creator. Who of course is made from paperclips.
- jsomedon 1y agouh.. Are these comments in this thread even serious? Because they surely feel odd to read.