Bing AIチャットをデフォルトのウェブ検索にして使ってみた

Bing AIチャットをデフォルトのウェブ検索に設定して2週間ほど使ってみたので、感想をレポートします。

https://www.bing.com/images/create

良い点

良い点としては「ウェブ検索結果の一覧を眺めて頭の中でまとめる」という作業をかわりにやってくれる網羅性があるので。専門用語と周辺知識のルックアップなどの場面では楽になりました。

不満点

反対に不満点としては、専門的な内容を検索したい時は検索結果のサマリだけでは目的の情報に辿りついてないので個別でキーワード検索してページを発見する必要があり、まわりくどさを感じました。

ブラウザからの使い方

以下のように設定しています。

  1. Bing Chat for All BrowsersGoogle Chromeからアクセスできるようにする。
    1. もしくはUser-Agent Switcher and ManagerでEdgeと同じUser-Agentになるようにwww.bing.comの設定をします
  2. ChromeのHome Pageをhttps://www.bing.com/search?q=Bing+AI&showconv=1に設定する
  3. ウェブ検索をする時に「+Shift+H」のショートカットキーを実行

検索クエリの言語

日本語と英語でどのような変化があるのか知りたかったので並行して試しました。

検索結果ページの言語情報に影響するので予想どうり英語で検索した方が情報量が多く目的の情報を得られました。

「質問文をチャット上の会話に沿うよう口語で書く必要があるか?」というのは微妙で、単にユーザーの入力をキーワードに分解されてBing検索しているように見えるので、文法などは適当でよさそうでした。

Google検索との比較

Google検索を使わなかったことで自分が多用しがちな操作が実感できました。これらは当然ですがチャット型ウェブ検索だと満せそうにないので併用する必要がありました。

言語を指定して検索(日本語のみ/英語のみ)

キーワードが英語だが検索結果は日本語ページを探したい時に「日本語のみ」に指定します。

例: https://www.google.co.jp/search?q=chatgpt&lr=lang_ja

検索結果のページに英語を優先したい時は「英語のみ」を指定します。

例: https://www.google.co.jp/search?q=chatgpt&lr=lang_en

日付を指定して検索

ソフトウェアのメジャーバージョン変更など、検索結果があらかじめ期間が限定されている場合や、前回検索した結果の追加情報を得たい場合に時間指定をしていました。

例:日本語で24時間以内にChatGPTについて書かれた記事を探したい https://www.google.co.jp/search?q=chatgpt&lr=lang_ja&tbs=lr:lang_1ja,qdr:d

site://を指定して検索

主にソフトウェアのドキュメントなど特定の専門情報を検索する時に多用しています。

  1. 公式ドキュメントを検索
  2. サイト内検索は使わずにGoogleでサイト内を検索

というパターンが多いです。

例:1週間以内に更新されたプラグイン関連のページをOpenAIのドキュメントから検索 https://www.google.co.jp/search?q=site:platform.openai.com+plugins&lr=lang_en&tbs=lr:lang_1en,qdr:w

Bing AIとLangChain、ChatGPTの各回答を比較

ここからはBing AIの外部仕様から仕組みを想像してみます。

  1. ユーザーの入力からBing検索にかけるキーワードを抽出
  2. Bingの検索結果20件のサマリから得た情報を回答になるように整形して表示

この推測どうりならBing AIとLangChainのBing Search Toolは近い結果を返すはず、と思ったの以下のように比較してみました。

「What is Bing AI, and how is it related to ChatGPT?」を各エージェントで質問してみます。

Bing AI(Precise)

Bing AI上でtemperature=0相当であろうTone=Preciseで得た回答。

Bing AI is a chatbot developed by Microsoft that runs on a version of GPT-4 customized for search. ChatGPT is a chatbot developed by OpenAI that runs on the GPT language model. Microsoft has invested billions in OpenAI, the creator of ChatGPT Bing AI and ChatGPT share a lot of similarities, but Bing AI can serve as a chat tool; write different types of content, from poems to songs to stories to reports; provide you with information and insights on the website currently open in the browser; and use its image creator to design a logo, drawing, artwork, or other image based on text.

LangChain - Bing Search Tool(gpt-4)

LangChain AgentからBing Search APIを通じて生成した回答、採用されている検索結果アイテムが微妙に違うことが分かる。回答の文字数は同じぐらい。

Bing AI and ChatGPT are both based on the GPT language model developed by OpenAI. However, they run different versions and have differences in how inputs are handled. As of April 2023, Bing uses a testing version of the GPT-4 model, while ChatGPT is on the older GPT 3.5-turbo model. Microsoft has integrated an AI language model into its Bing search engine, which is said to be more powerful than ChatGPT. Microsoft has invested more than $11 billion into OpenAI, ChatGPT's creator, since 2019.

生成のためのコードは以下を実行しました。

from langchain.agents import initialize_agent, AgentType
from langchain.chat_models import ChatOpenAI
from langchain.tools.bing_search.tool import BingSearchRun
from langchain.utilities import BingSearchAPIWrapper

llm = ChatOpenAI(model_name='gpt-4', temperature=0)
bing_search = BingSearchRun(api_wrapper=BingSearchAPIWrapper(k=20))
agent = initialize_agent([bing_search], llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
agent.run("What is Bing AI, and how is it related to ChatGPT?")

ChatGPT(gpt-3.5-turbo)

ChatGPTにはBingとOpenAIが統合されているという知識データを持たないので「別のものです」という答えを返します。

Bing AI is an artificial intelligence system developed by Microsoft for use in its Bing search engine. The system uses machine learning algorithms and natural language processing techniques to help improve the accuracy and relevance of search results, as well as provide more personalized recommendations and suggestions for users. ChatGPT, on the other hand, is a language model developed by OpenAI that uses deep learning algorithms to generate human-like responses to natural language inputs. ChatGPT is not directly related to Bing AI, but it is an example of the type of AI technology that could be integrated with a search engine like Bing to provide more sophisticated and helpful search results. Additionally, Bing AI and ChatGPT both utilize machine learning and natural language processing techniques, and they share some common goals, such as improving the accuracy and relevance of information retrieval.

ChatGPT(gpt-4)

gpt-3.5-turboと同じくBing AIの知識を持たないのですが、インサイダーのGPT-4の知識はあるようでChatGPTで使われていると説明します。

Bing AI refers to the artificial intelligence technologies developed and used by Microsoft's Bing search engine. Bing AI encompasses a range of technologies, including natural language understanding, machine learning, and deep learning algorithms, to provide more relevant and accurate search results, personalize the search experience, and improve the overall user experience. ChatGPT, on the other hand, is an AI language model developed by OpenAI. It is based on the GPT-4 architecture and is designed to understand and generate human-like text based on the input it receives. ChatGPT can be used for a variety of purposes, such as answering questions, generating content, summarizing text, and assisting in conversations. The relationship between Bing AI and ChatGPT is that they are both AI technologies aimed at improving human-computer interaction, but they are developed by different organizations (Microsoft for Bing AI, and OpenAI for ChatGPT). They may share some underlying principles and techniques, such as natural language processing and deep learning, but they are distinct implementations serving different purposes.

perplexity.ai

ついでにperplexity.aiも並べてみます。BingとGPT-4の関係に言及がなく、英語と他言語による差を別の記事から参照していました。

Bing AI is an AI chatbot integrated into Microsoft's Bing search engine. It is based on the same fundamental language model as ChatGPT, known as GPT-3. However, Bing Chat has the ability to pull from more recent web sources and has undergone additional training to make it more capable of following instructions and completing more nuanced tasks. While both ChatGPT and Bing Chat are based on similar language models, there are some distinct differences between them. Bing Chat offers a wider array of non-English languages, while ChatGPT is more focused on English.

考察

Bing AIとLangChainがBing APIとGPT-4で生成した文章には似た点もありますが、LangChainがデータを繋ぎあわせた原始的な生成に近いのに比べると、Bingのが若干Genralな内容をピックアップして仕上げてくる印象です。

またBingやLangChainが返す回答の文字数はChatGPTの結果と比較すると短かくなる傾向があります。

Bingの方はブラックボックスなので定かでないないがLangChainと似たアーキテクチャだとすると検索結果をコンテキストとしてpromptに注入してトークン数を消費するのでChatGPT程の長い回答を生成できないのだと思いました。

ただBingとLangChainはイコールではなく、Semantic Kernelで構築されたPrometheusモデルと呼ばれる別の実装でより複雑なシステムを構築していると思われるので、今後差が顕著になってくるかもしれません。