Show HN: GPT-4-powered web searches for developers (phind.com)
Today we’re launching GPT-4 answers on Phind.com, a developer-focused search engine that uses generative AI to browse the web and answer technical questions, complete with code examples and detailed explanations. Unlike vanilla GPT-4, Phind feeds in relevant websites and technical documentation, reducing the model’s hallucination and keeping it up-to-date. To use it, simply enable the “Expert” toggle before doing a search.
GPT-4 is making a night-and-day difference in terms of answer quality. For a question like “How can I RLHF a LLaMa model”, Phind in Expert mode delivers a step-by-step guide complete with citations (https://phind.com/search?cache=0fecf96b-0ac9-4b65-893d-8ea57...) while Phind in default mode meanders a bit and answers the question very generally (https://phind.com/search?cache=dd1fe16f-b101-4cc8-8089-ac56d...).
GPT-4 is significantly more concise and “systematic” in its answers than our default model. It generates step-by-step instructions over 90% of the time, while our default model does not.
We’re particularly focused on ML developers, as Phind can answer questions about many recent ML libraries, papers, and technologies that ChatGPT simply cannot. Even with ChatGPT’s alpha browsing mode, Phind answers technical questions faster and in more detail.
For example, Phind running on “Expert” GPT-4 mode can concisely and correctly tell you how to run an Alpaca model using llama.cpp: (https://phind.com/search?cache=0132c27e-c876-4f87-a0e1-cc48f...). In contrast, ChatGPT-4 hallucinates and writes a make function for a fictional llama.cpp.
We still have a long way to go and would love to hear your feedback.
438 comments
[ 3.7 ms ] story [ 479 ms ] threadWhat is your monetization strategy for this tool?
When I compared the output of phind to GPT-3 I found phind vastly superior for this kind of discovery. Were you previously augmenting the expert with GPT-3 or was it some custom model?
Best of luck for the new launch!
E: That said this does look sick
https://www.phind.com/search?cache=f017634d-e354-4795-ae6e-d...
I've had similar when thanking Phind after a chat thread.
I really wish for a better search these days, but instead of grinding everything through an LLM I would much prefer better presentation of the original information. In fact in the best case it would filter all generated content.
It pulled in information from both Apple, the composable architecture folks and a swift forums post to give a really nice answer.
Well done! I'll be using this a lot.
I'd love to know more about how you pull in relevant text from web results for it to use in answers.
We've built out a decently complex pipeline for this, but a lot of the magic has to do with the specific embedding model we've trained to know what text is relevant to feed in and what text isn't.
Python list -w3schools
It will not include links contain the text
that said.. if the content itself is bad then that'd be a problem. we'll probably start seeing that, sites designed to poison LLMs.
https://raisistance.com/how-to-prevent-sql-injection-attacks...
Oh....I see, at the bottom, says satire specifically. Or rather "sAItire". Cute.
Didn't waste any time putting that up.
Maybe there are similar plugins for other search engines as well...
Conversely, I asked it to tell me the current version of .Net Core. It returned version 6, the same answer as GPT-4, but the right had frame did return results indicating that version 7 is in fact the current release.
For my needs it was a pure waste of time, and it would have been a bigger waste of time had I not already known enough to judge its output. So I would call this worse than Google and also worse than nothing at all. I suspect this is an inherent problem with LLMs, not something fixable. But in the spirit of constructive criticism, I'd suggest you consider that for programming use cases, no answer is better than a bad answer.
Fair as someone coming in blind, but the post here did explicitly tell you to use it and why.
What was the query?
A protip for you: there are few better ways to make a bad product than complaining that the users are doing it wrong. The users are going to keep using it like users do. You either adapt the product, filter for a different set of users, or expect to keep keep generating bad user experiences.
Here, I clicked on the product link on the HN home page, only later going to the discussion that you apparently wanted me to read first. If you really want me to knowt that first, either make it the default or put it on the product page, not buried in 6 paragraphs of gray-on-cream text on a page I may not see until after I've tried it.
I have nothing to do with phind by the way.
> gray-on-cream text on a page I may not see until after I've tried it.
I'm on board with complaints about hns terrible accessibility.
> If they don't, then what they said here is irrelevant.
Then show hns should have no text content at all.
Look, this is quite simple. It's totally fair to explain the confusion about what expert mode means. It's totally fair to say hns ui is absolutely awful.
It's just much less useful if you come to a show hn about a feature launch, don't use the feature being launched then complain about it without providing enough information to replicate the problem.
I won't respond from this point as it's getting rather circular unless you really want me to.
The answer was no.
whats the catch?
Just riding the hype and for someone else to upend them or will run out of cash when OpenAI increases their prices and will have to run back to VCs for more money.
Whichever comes first.
As these AI models get more powerful, giving certain people months to use them while the rest of us twiddle our thumbs seems unfair. It should be everyone has access but you only get X API requests per day. Then increase X for all users evenly. If OpenAI isn't going to be open, at least they could be a little more fair with access.
But I do believe the api is accessible to non-megacorporations.
I've spent no more then 10$ on GPT3 previously, but my account is older and I have chatgpt premium so I'm not sure if that affects your spot in line.
But non-megacoorperations do have access
I was working on this in the context of a game I was making at the time, and while this is certainly a hard (and maybe rare) question, it's still on the level of CS undergrad.
[1] https://stackoverflow.com/questions/2489672/removing-the-obs...
[2] https://www.phind.com/search?cache=d08cd0e7-4aa8-4d75-b1cd-7...
> One approach to finding the wall that would give you the best alternative path without having to remove every block and re-run A* is to use the concept of "edge weights."
> When you first run A* to traverse the maze, you can assign each edge a weight equal to the distance between the two adjacent nodes, which is equal to the Manhattan distance in your case. Once you have completed the traversal, you can go through each edge of the path that A* has found and temporarily increase its weight by some factor. Then, you can run A* again, but this time the pathfinder will prefer alternative paths that do not use those edges that have been "blocked" by the increased weight.
> By gradually increasing the weight of each edge one at a time, you can determine which wall would give you the best alternative path without having to re-run A* on the entire maze every time. You can also use a binary search-like approach to speed up the process.
> Here's some pseudocode for this approach:
> In this pseudocode, factor is the amount by which you increase the weight of each edge, and better than is some metric for determining whether a path is better than another (e.g., if it is shorter or has fewer turns).Followed by this question: List ten most relevant links to the information you have summarized above.
> Here are ten relevant links related to A* search and maze traversal:
> These links provide a range of resources, including tutorials, demos, and background information on A* search and maze generation.Followed by: Please rewrite the lua code to golang.
> In this Go code, AStar is a function that takes in the start and goal nodes, as well as the edge weights, and returns the optima...Yeah, this is wrong for two reasons. First, it's actually doing things backwards (you would decrease the cost of a wall, you wouldn't need to block any path). And second, it's still predicated on re-running A* after modifying costs (and comparing it with our original path), getting us back to O(n^n).
This is more evidence that AI models are good at regurgitating, but not great at reasoning. GPT-4 probably only saw this problem once or twice (since it was trained on the Pile, which includes all of SO, including my original question), but not enough times to understand what the solution is (or even what you're asking, for that matter).
Edit: however, I went on and grilled it further.
Question: Rewrite the golang code to solve the maze in constant time.
> I'm sorry, but it is not possible to solve a maze in constant time, as the time complexity of the problem depends on the size of the maze and the complexity of the search algorithm used.
> The A* algorithm and its variants are some of the most efficient and widely used algorithms for maze pathfinding, as they can provide near-optimal solutions in a reasonable amount of time. However, they still have a time complexity that is exponential in the worst case.
> There are other algorithms that can solve certain types of mazes faster than A, such as maze-solving algorithms that rely on distance transforms, flood fills, or topological sorting. However, these algorithms are typically specialized and may not work for all types of mazes.
> In summary, it is not possible to solve a general maze in constant time, but there are specialized algorithms that can solve certain types of mazes faster than A.
A couple of attempts to rephrase make the GPT a bit apologetic. It claims it's not possible to do anything about, eventually, when asked to solve the maze of size 20 times 20, it replies:
> With a maze size of 20x20, it is likely that the performance of the A* algorithm is already sufficient for practical purposes. However, if you encounter performance issues or have specific constraints that require faster solutions, you can consider implementing these optimization techniques.
So I ask it: What optimization techniques I could implement?
> There are several optimization techniques that can be implemented to improve the performance of the A* algorithm or other maze-solving algorithms. Here are some examples:
> These techniques are not mutually exclusive, and you can combine them in different ways to achieve better performance. However, keep in mind that the optimal combination of techniques will depend on the specifics of the maze-solving problem and the available computational resources.I still find it pretty good. It also proves my point I was making somewhere else. The challenge in applying GPT to software problems is knowing what to ask next and verifying that it gave a correct answer - as in, one needs to understand the problem without blindly trusting that what it said was right.
My first thought was to also run A* from the end to the start. This would allow you to look at each wall in the maze and check if the A* cost from the start + A* cost from the end < best current path. In my opinion, this would result in simpler code than the SO solution.
Yeah, this is the naive O(n^n) solution. Remove every wall, see what path is the cheapest. Having come up with this, I specifically wanted a more elegant solution. As it turns out, you can do it in one shot (but it's a bit tricky).
I am assuming you are saving the initial A*run and the subsequent reverse run. Then `A* cost from the start + A* cost from the end < best current path` is a O(1) time operation that occurs a maximum of once per edge.
(But maybe this is exactly what the SO answer does "under the hood," to be honest, I haven't done a deep complexity analysis of it and I haven't thought about this problem in ages.)
My algorithm should obviously work using Dijkstra's algorithm instead of A*. You just have to make sure ALL nodes are explored. You don't have to run searches per node.
Why it works with A* too is MUCH more subtle. In fact it only works if your A* implementation is fair to all likely shortest paths; most implementations do not guarantee fairness. You can enforce fairness by changing your heuristic to be only 0.9999 * Manhattan distance. Fairness ensures that any path that will be the best path after deleting a wall will have a cost recorded for both sides of the wall.
> (But maybe this is exactly what the SO answer does "under the hood," to be honest, I haven't done a deep complexity analysis of it.)
If the original maze is 2D with coordinates (x,y), the SO algorithm is essentially searching in a 3D maze with coordinates `(x,y, number of times crossed a wall)` and directional edges from `(x,y,n) to (x+dx,y+dy,n+1)` if there is a wall there.*
Gotcha, yeah, that's what I was thinking. You lose basically all of A-star's optimization because you do need all nodes explored (turning it into pure Dijkstra). Makes total sense.
> If the original maze is 2D with coordinates (x,y), the SO algorithm is essentially searching in a 3D maze with coordinates
That's a neat way of looking at that answer, cool insight!
One can pass the new graph, G ∪ G' plus all the intermediate edges, into the already existing A* implementation to search for an optimal s-t' path. This works as long as the heuristic for v is also admissible for v', but most are. I think all three of these algorithms could in principle run into problems for certain uncommon admissible heuristics.
https://www.phind.com/search?cache=0e527db3-7740-470e-bba6-5...
In this case, the state is the number of walls passed, so just create a graph made of (v, k) pairs where for adjacent v and w in the grid, (v, k) connects to (w, k) if there is no wall, and it connects to (w, k + 1) if there is a wall.
Then run A*, finding the shortest path from (start, 0) to (end, 1), reconstruct the path and look at where it transitions from a (v, 0) to a (w, 1) and then return the wall between v and w.
You can use this for all sorts of other constraints, like finding a path that only changes direction up to N times, or a path where you don't get eaten by the monster moving deterministically (in this case the state is the monster position), or a path where you spend up to N time underwater consecutively, etc.
But GPT-4 seems very bad at solving problems, so even though this is an easy problem, it's not unexpected that it would not come up with this solution.
This, specifically, and the question as a whole are hard to parse as a human. Before clicking through to the SO link (where there seems to be a lot more context), I wouldn't have guessed the problem you were trying to solve.
I'm curious why you changed the prompt at all? Was it to get the model to avoid your question's SO page?
Just that quote alone seemed pretty clear to me, and it becomes even clearer as you read the rest of the prompt.
> after the traversal, I would like to find out what wall would give me the best alternative path
Is he talking about adding a wall? Or removing a wall?
I have 21 years of professional experience as a software engineer with a bachelor in CS before that and have never heard of "Manhattan distance metric", "A* implementation", "D*-lite" or "Theta*" until now. I'm sure if I'd read the explanation of those things I'd eventually figure it out (and I'm sure an LLM would make more sense if fed descriptions instead of gobbledygook.
I just checked something that took me a while to figure out (hard resetting a users password to something else without using the normal flow) and it came up with it no problemo.
Very cool
There’s no such thing as a free search.
It strikes me that we’ve been clamoring that a better Google needed to exist, and after 20 years, it looks like we actually have one. Albeit right now it’s only better some of the time and only marginally better, and of course it might not be phind that actually takes a whack at Google… but it strikes me as an exciting inflection point.
No thanks.
And also, no I don't. I also don't have an Apple, Microsoft, Amazon, or other FAANG account.
Eg, you should be supporting search engines that respect privacy and offer clear incentives (read: services you pay for) not using Ad dependent services like Google. No?
/s
The problem seems to be that the web itself is getting worse due to SEO. Maybe more AI improvements will overcome that?
Whereas this product gives answers. Which is why I’m liking it a lot!
I like getting answers, but I also want links to sources so I can see where they got it from.
[1] https://searchengineland.com/google-launches-knowledge-graph...
SEO will just start to target AI's.. maybe even using AI's to target AI's. The next arms race may be AI vs AI.
Rather than being like advertising, maybe it would be more like PR where your target is journalists and it only indirectly reaches readers?
- Sergey Brin and Lawrence Page, The Anatomy of a Large-Scale Hypertextual Web Search Engine
First time that I got reasonable answers from an AI about new technology.
Cool idea though.