Lurker News
Hi HN,

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.

Comments (414) 162 threads

Show all comments

Showing thread 11 of 162

9dev1 reply#
Just tried it with a PHP question regarding type safety, and it completely made up some lovely syntax I wish the language had, but doesn’t. It got lots of things right, but that one crucial detail wrong.

That makes it the same dangerous tool as ChatGPT that is useful to experienced coders, but utterly disastrous for newcomers.
> Question: > in php using psalm, how can i specify template parameters for newly constructed instances?
> ANSWER

  // Create a new instance of MyClass with a string parameter
  $my_instance = new MyClass("Hello World!");

  // Call the getValue method to retrieve the value
  $value = $my_instance->getValue();

  // The $value variable is now a string
  echo gettype($value); // outputs "string"
> To create a new instance of MyClass with a specific parameter type, we use the syntax new MyClass("Hello World!");, where string is the type we want to use for T, and "Hello World!" is the value we want to pass to the constructor.

> We can then call the getValue method to retrieve the value, which will be of type string.

naiv1 reply#
I think if you are more specific , you should get a much better response.

I tried it with
Using php 8.1 and the static analyzer psalm, how can i specify template parameters for newly constructed classes?
and got a very good result including detailed explanations

9dev#
Oh yeah? I get the following delightful but equally wrong snippet:

>Another way to achieve a similar effect is to use PHP's built-in generics feature. This feature was introduced in PHP 8.0 and allows you to specify the type of a class property or method argument as a generic type. Here's an example:

  class MyList {
      /** @var array */
      private $items = [];

      public function add(T $item): void {
          $this->items[] = $item;
      }

      public function get(int $index): T {
          return $this->items[$index];
      }
  }
> In this example, we use the syntax to specify that MyList is generic and that it has a type parameter T. We then use the T type in the same way as before to specify the type of the $items property and the add and get methods.

> Using generics in this way has the advantage of being built into PHP, so you don't need to use any external libraries or tools. However, it can be a bit more verbose than using PHPDoc comments, and it doesn't provide the same level of type checking as Psalm.