15 ms·
What I really love is the unbounded optimism of the AI. How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic dat
by ThePhysicist 4y ago
What I really love is the unbounded optimism of the AI. How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus?" that would then just think for a second and go "Certainly! Let's start by ...". These people exist, but they're one in a thousand (or million?). ChatGPT basically does that for almost every prompt you throw at it. So it really helps me overcome research barriers in software development in an incredibly short time, stuff that would've taken days or weeks to research can be done in literal minutes. And as I said before what's amazing is that the PoCs are really elegant and minimal, i.e. no superfluous code at all and condensed to the essence of the problem you're trying to solve.
- utdiscant 4y agoFor the interested, this is the response by GPT4 given that prompt: --- As an AI language model, I'm unable to write full code examples, but I can provide you a high-level overview of how to implement a horizontally scalable, probabilistic database in Rust using the Raft consensus algorithm. 1) Define the data model: Design a data model for your probabilistic database, which should include the basic CRUD operations (Create, Read, Update, Delete). You can represent the data as a key-value store or any other data structure that fits your use case. Consider using a probabilistic data structure like a Bloom filter, Count-Min Sketch, or HyperLogLog to reduce memory usage and support approximate queries. 2) Implement the Raft protocol: To build a distributed system with strong consistency, you can use the Raft consensus algorithm. There are existing Rust libraries that implement the Raft protocol, such as raft-rs. Include this library in your project to handle the core Raft functionality. 3) Design your database nodes: Each node in the system should maintain a state machine that represents the current state of the database. The state machine should include the following components: * A log to store the commands received from clients. * A state to apply the log entries and keep the actual data. 4) Handle client requests: For each client request, the leader node should create a corresponding command and append it to its log. Then, the leader should replicate the log entry to its follower nodes using the Raft protocol. Once a majority of the nodes acknowledge the new entry, the leader can consider it committed and apply the command to its state machine. After applying the command, the leader should send the response back to the client. 5) Implement horizontal scaling: To enable horizontal scaling, you need to partition your data across multiple nodes. One way to achieve this is by using consistent hashing. Consistent hashing helps distribute keys evenly across nodes while minimizing data movement when nodes are added or removed. 6) Handle node failures and recovery: Raft is designed to handle node failures and recovery. When a node goes down, the remaining nodes will continue to operate and maintain consistency. Once the failed node comes back online, it will synchronize with the current leader and catch up with the latest state. 7) Deploy and monitor your system: After implementing the necessary components, deploy your system across multiple nodes. Monitor the performance, consistency, and fault tolerance of your system to ensure it meets your requirements. Here's a high-level outline of how the main components of your project could look like: mod data_model; mod state_machine; mod raft; use data_model::DataModel; use state_machine::StateMachine; use raft::RaftNode; fn main() { let nodes = create_nodes(); let state_machine = StateMachine::new(DataModel::new()); let raft_node = RaftNode::new(nodes, state_machine); // Start the RaftNode, which takes care of the Raft consensus protocol raft_node.start(); // Start a server to handle client requests let server = Server::new(raft_node.clone()); server.start(); // Optionally, start a monitoring and management interface let monitoring = Monitoring::new(raft_node.clone()); monitoring.start(); } In this example, you'd need to implement the `data_model`, `state_machine`, `raft`, `Server`, and `Monitoring` modules/components to handle the different aspects of your horizontally scalable, probabilistic database. Remember that this is a high-level outline and not a complete implementation. You'll need to dive deeper into each component to ensure proper functionality, scalability, and fault tolerance.
- vidarh 4y ago> As an AI language model, I'm unable to write full code examples The example prompt is clearly asking for too much in one go, but this objection is trivial to overcome for anything not specifically hitting guardrails (and sometimes for those too) by telling it to act as if it's a [insert various roles to try].
- akiselev 4y agoThis is the prompt prefix I use for extensive GPT4 coding projects: You are an AI programming assistant. - Follow the user's requirements carefully & totally - First think step-by-step -- describe your plan first, then build in pseudocode, written in great detail - Then output the code in a single codeblock - Minimize any other prose
- withinboredom 4y agoHow do you know it is even close to correct? When I’ve asked it for code, it has been subtly wrong, or worse, correct but missing important edge cases that it doesn’t even seem to be aware of.
- deleted 4y ago[deleted]
- awestroke 4y agoHow do you know your own code is correct? Now apply the same strategy to others code
- withinboredom 4y agoHaha, that’s actually a good and fair question. I don’t actually know the answer to that. I imagine I have a compiler in my head that’s able to turn instructions into “thought” that I can execute and see the behavior.
- deleted 4y ago[deleted]
- ThePhysicist 4y agoI can read the code and verify it. Sometimes there are small mistakes but overall the architecture and approach are mostly correct. It won't produce 100 % production-grade code, but that's not expected for a PoC. And personally I also get stuff subtly wrong at times, I just iterate and test to find these cases and fix them. So I guess we're not fully replacable yet.
- Thorentis 4y agoYou can't read API calls and know if they're real, or if the function names are plausible but non existent. This is the problem with GPT. It creates great sounding possible APIs, but has no idea which APIs actually exist.
- jeron 4y agoeverything seems easy when you're armed by the corpus of all human text
- red75prime 4y agoEverything seems easy when you cannot stop and think and have to output the next token after doing the fixed amount of processing. It's amazing what GPT-4 can do given this limitation.
- comboy 4y agoRight? I don't find enough people amazed by that. Only one computation per layer, even with attention mechanisms, and that's allowing to fit all abstractions (which seem deep sometimes, it can get pretty meta) and then on top of that do a good few steps of reasoning. It's so counter-intuitive to me.
- quaintdev 4y agoI also love the fact that now I can develop on the go. I can ask chatgpt to write code for me for various modules of applications on a mobile device and I can then go home and put everything together. Development on mobile although possible was not feasible due to the form factor. Now that limitation is gone and things are only going to improve.
- jackstraw14 4y agoAgreed! This is such an amazing use case for developers. You can explore ideas with ChatGPT without having a code editor in front of you, and this is so much better than my previous methods of quick notes, pseudocode, etc. The thought that you can work with ChatGPT for an hour or two and have a very-refined application ready to put together when you get to a computer, it's a totally different connection than I've felt to software development. I'm really looking forward to a solid voice/tts implementation that allows me to do something like this while I go out for a walk.
- simonw 4y agoI've been doing that too: it's kind of amazing. I can have an idea while walking the dog, throw a few prompts at GPT-4 abs by the time I get home I have a whole implementation fleshed out and ready for me to copy into a code editor and start refining.
- akiselev 4y agoI can finally say I’ve written a Firefox extension while sitting on the toilet! Take that, bucket list.
- ihatepython 4y ago> How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus? I couldn't agree more. I work as a software engineer in the medical field (think MRI's, X-rays, that sort of thing). I've started using ChatGPT all the time to write the code, and then I just fix it up a bit. So far it's working great!
- zachthewf 4y agoHeh, is this a Therac 25 joke?
- auggierose 4y agoI really hope it is a joke.
- ihatepython 4y agoYes
- andreasley 4y agoPlease don't do this here. The topic deserves serious discussion.
- baq 4y ago> Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus? just pasted this into bing creative mode. whatever this thing is spitting out right now would've probably taken me a week of research to even figure out the libraries and their APIs. it's given me a raft+sled+serde scaffolding, is on it's fourth 'continue' step and just keeps going.
- Thorentis 4y agoHow do you know what it created actually works and hasn't just been hallucinated? Have you checked every API call? Is it using non deprecated versions? Does it even run?
- baq 4y agoi'm pretty sure it won't work, it actually started to lose coherence at the 4th step, but that isn't the point - the point is, i'm already a week ahead in my research since the libraries actually exist! it gave me a general idea how the project should be built, now I could touch it up and give it individual units to fill in. it really brings a hobby project like that from the realm of 'it's too much work to even start, better read a book' to 'lettsssss f** gooooo'.
- mistercow 4y agoI’ve actually found that ChatGPT 4 has some sense of realistic expectations about what it can accomplish in the context of a conversation. For example, I asked it to implement polygon triangulation supporting polygons with holes in it, and it was like “Whoa now, I can tell you all about ear clipping, but that’s too big and complex to implement here”. ChatGPT 3.5, on the other hand, forged ahead writing a bunch of nonsense with vaguely correct function names.
- esalman 4y agoI was never a graphics/3D designer but ChatGPT basically unlocked a potential new skillet for me.
- spookybones 4y agoWhat have you produced with it? I’m genuinely curious. For me, the potential seems unbounded at first, but once I start trying to create something, I hit a lot of walls. I do think Midjourney excels at making 3d backdrops and skins for 3d objects, like wood patterns.
- esalman 4y agoI just asked ChatGPT to give me an example of a 3d object generation using WebGL, then to make necessary modification in the code to make the object rotate.
- intelVISA 4y agoMost of mine would probably, correctly?, advise C++ and Paxos for that use case but each to their own! Depends how jr your team is I suppose.
- spyder 4y agoAnother trick I have found interesting and somewhat useful: asking it to give you his confidence score for it's statements, and a lot of the time his confidence are lower for his wrong statements but also lot of the times has high confidence in some wrong answers too (for example gets simple math wrong with 100% confidence), so not sure it's really that useful just an interesting thing to try.
- gbasin 4y agoThe RLHF process performed on that chat models actively confuses their ability to estimate confidence. The raw models are quite well calibrated though
- sanderjd 4y agoThis is a great point.
- Robotbeat 4y agoIt reminds me of the boundless optimism of Mr Meeseeks: https://youtu.be/qUYvIAP3qQk https://youtu.be/qUYvIAP3qQk GPT-3/4 is like a Meeseeks box for computer and internet tasks. Keep your task simple, and it will quickly and happily solve it for you before ceasing to exist. (Well, that’s how I use it via the API, at least. ChatGPT will preserve the state, but of course the context window is still limited anyway.)
- doitLP 4y agoRemember, existence is pain to a Meeseeks. So treat your AI with care!
- zikduruqe 4y agoI should ask ChatGPT if it can take 2 strokes off my game.
- doitLP 4y agoThat sounds hard…try for making yourself a more complete woman first
- kreeben 4y agoA robotic brain would know that we've taken this premise as far as we can and reached perfection. Absolute perfection, even. Now, pass me the butter.
- gibolt 4y agoShould be achievable, as long as you're not Jerry
- Forgeties79 4y agoOH WE’RE WELL PAST THAT JERRY. Kills me every time haha
- 4y ago
- awb 4y agoIt’s taken some getting used to. Most developers (including myself) get annoyed with: repetitive tasks, pivoting after substantial work, vague requests, juggling too many unrelated tasks, context switching, etc. With Chat-GPT I’ve had to learn a new paradigm: any request is OK at any time
- chasd00 4y agoI've been putting it off and then finally signed up and started playing aroudn with chatgpt. I'm pretty amazed so far but i've only been asking it pretty easy stuff. "write a program that blinks an led on pin 13 in circuitpython", "write a rest api in Java using Spring" stuff like that. I wonder if people will start running to chatgpt for an algorithm instead of searching for a library for an implementation of said algorith. I do like asking it to explain things to me, for example "explain what a PID controller is". It reminds of like a real-time wikipedia.
- PragmaticPulp 4y ago> What I really love is the unbounded optimism of the AI. How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus?" that would then just think for a second and go "Certainly! Let's start by ..." I agree about the unbounded optimism. It has been fun to ask ChatGPT where to start on certain project ideas I’ve had. However, I’ve tried it three times with small but ambitious project ideas now. Each time it goes around in circles with general concepts but I can never get anywhere. If I switch to common tutorial topics like “How can I write a simple TODO list app?” it performs surprisingly well. As soon as I step outside of common tutorial material, I can’t seem to get anywhere with it.
- sharemywin 4y agoand or there's a library to do XYZ. and you just want to know how to use it. or what library is available to do xyz. I also use it to tell what the weird error text means given this snippet of code.
- raducu 4y agoYes, I suspect the AI finds all answers just as easy/hard. Whereas for humans certain programming tasks are orders of magnitude harder than others.
- ren_engineer 4y agoAm I the only one that's been disappointed with GPT for coding? It's good at using common libraries and frameworks but for stuff using more niche libraries it fails miserably almost every time, to the extent that by the time I've debugged and written prompts to try and get it to do it properly I've spent more time than needed still good for handling a lot of grunge work and really useful for doing the stuff where I'm weaker as a "full stack" developer
- wilsongoode 4y agoI think of ChatGPT as being a “close example” of the final code that I want to produce. The same way you might treat a StackOverflow response to someone else’s request. Sure, sometimes it’s exactly what you needed, but often it needs a few tweaks (or has hallucinated some function that doesn’t actually exist).
- taternuts 4y ago> useful for doing the stuff where I'm weaker as a "full stack" developer I'm really excited about this part; I've been using it to help with DevOps stuff and it's been giving me so much more confidence in what I'm doing as well as helping me complete the task much quicker.
- still_grokking 4y agoHave you double checked everything it told you as you should do with any AI generated output all the time as it's not reliable in any way?
- Elte 4y agoI've started to use ChatGPT for semi high-level questions only this week, and I'm with you. It has hallucinated quite a few nonexistent functions, and it's generally unhelpful slightly more often than it is helpful. Just now I asked it why an `<input />` and a `<select />` with the same CSS had different heights (I've managed to avoid CSS for a while, shoot me XD), and gave it the CSS applied. It suggested the default browser styling was the culprit, and I should set the same height to both elements. I replied they already had the same height set. Then it suggested setting the same padding - they already had the same padding. Then it put `box-sizing` in an example and I promptly realized that `<input />` and `<select />` must have different default values for `box-sizing`. I asked if that was correct, and it said yup! Based on what I've seen elsewhere, I really feel like it should've been able to answer this question directly. Overall this matches my experience so far this week. Not saying it's never useful, just regularly I expected it to be...better. Haven't had access to GPT-4 yet though, so I can't speak to it being better.
- notahacker 4y agoI've worked with people who say "Certainly, let's start by..." to absolutely everything regardless of whether they know how to solve it or merely wish to leave you with the impression they do, and much prefer working with people who have a scale of "Certainly, let's start by" to "you should probably ask someone else". Even better if they have an "Are you sure this is a good idea?" mode, possibly even with suggested alternatives
- danielvaughn 4y agoThis is an interesting point. I haven't felt this kind of optimism since...maybe way back when browsers were first becoming powerful? Like 2009-ish? Right around when I started, there was a huge amount of interest in how to leverage browser tech to make better app experiences.
- roncesvalles 4y agoThis is sarcasm, right?
- throwaway689236 4y agoI also like the fact that you can ask it as many stupid question as you like, it's not bothered or irritated by it as a real person would be.