Tuesday, March 12, 2024

Expanding the Capabilities of Generative AI with Retrieval-Augmented Generation (RAG)

Retrieval-Augmented Generation (RAG) represents an innovative advancement in generative artificial intelligence, enabling us to leverage data "beyond the model's scope." This refers to external information that was not integrated into the model during training. By integrating RAG, we can add essential guardrails to the generated output and minimize instances of hallucination. 

RAG offers valuable applications across various generative AI use cases, such as: 

  • Question-answering systems
  • Text summarization
  • Content generation 

To better grasp RAG's functionality, consider a human interaction analogy. Imagine providing a document to an individual and requesting they generate an answer based on the information within that document.

The two primary components of RAG are: 

  1. Retrieval step: In this stage, we search through extensive knowledge bases (documents, websites, databases, etc.) to identify data relevant to the model's instructions. 

  2. Generation step: Similar to traditional generation use cases, this phase generates a response or content based on the information retrieved during the initial step. The crucial distinction lies in how the retrieved information is utilized – it serves as context and is incorporated into the prompt provided for the generative model.

In the realm of vector databases, unstructured data is transformed and stored as numeric representations, which are commonly referred to as embeddings for AI applications. Embeddings are derived by employing embedding models such as word2vec. Consider the illustrative example of a semantic search for the term "computer". Observe the closest matching words in the table below, with distances measured numerically since the search was executed utilizing vector (numeric) data. Feel free to test additional words on this platform. https://projector.tensorflow.org/











Tuesday, March 5, 2024

Harnessing the Power of Generative AI for Business

In the ever-evolving landscape of computer science, Artificial Intelligence (AI) has seen its fair share of enthusiasm and skepticism over the decades. The early 2010s brought a wave of excitement as IBM Watson's triumph on Jeopardy! against human champion Ken Jennings (2011), followed by Google's AlphaGo defeating world champion Lee Se-dol in Go around 2016, fueled the belief in AI's potential applicability beyond imagination. At that time, I didn't envision AI being utilized for general domain Q&A or problem solving. However, with the emergence of foundation models like ChatGPT in 2022, my perspective was broadened significantly. 

While businesses entertain the idea of adopting these capabilities, it is crucial to recognize that enterprise application varies greatly from personal exploration. Security concerns, model understanding, explainability, and data privacy are non-negotiable. To effectively integrate AI into Enterprise applications, it must be designed with four key aspects: Openness, Targeted Application, Trustworthiness, and Empowerment.

  • Openness: Openness highlights the significance of making AI technologies accessible to all. By sharing knowledge, research, and tools, we foster collaboration and innovation. Open AI frameworks, datasets, and algorithms encourage a broader range of individuals and organizations to contribute to AI development.

  • Targeted Application: Targeted Application: Targeted application refers to deploying AI in specific problem areas where it can yield significant positive impacts. Sectors such as healthcare, education, climate change, or poverty alleviation offer opportunities for AI optimization and tackling complex challenges. Examples include talent/HR productivity enhancement, customer service through conversational AI, and app modernization using automated code generation and transformation capabilities.

  • Trustworthiness: Trust is essential for successful AI adoption. Transparency and accountability are vital when designing and deploying AI systems. Explainable algorithms enable users to understand decision-making processes, addressing biases and ensuring fairness. Data privacy and security safeguard individuals' rights and prevent misuse.

  • Empowerment: The future of AI lies in empowering individuals rather than replacing them. AI technologies should augment human capabilities, enhancing efficiency and effectiveness. They can foster creativity, productivity, and better decision-making abilities. 

Benchmarking LLMs in the Wild

 

Have you ever wanted to compare the results of different LLM models from the same prompt? Enter https://chat.lmsys.org/, a powerful tool for comparing the performance of different LLM models on the same task. With this tool, you can easily input multiple LLM models and their corresponding outputs, and then view a comparison of their results side-by-side. You can easily compare the performance of different LLM models on the same task, and gain valuable insights into their strengths and weaknesses. 

Here is the example that I used the same prompt from my previous post.


Explain me the following command.

podman run -d -p 3000:8080 --network slirp4netns:allow_host_loopback=true -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main 



Happy modeling! 


Local LLM deployment framework - Ollama

Are you looking for an easy way to run LLM on your local environment? Ollama seems like a straightforward option. Open-WebUI (formerly known as Ollama-webui) even gives you a chatGPT-like web interface! To get Ollama up and running, you just need to follow a few simple steps.

Step 1: Install Ollama locally and deploy your preferred LLM. For example, you can run the command

 $ ollama run llama2 

to download the llama2 model. Ollama supports a variety of models available on ollama.com/library.

Step 2: Run Open-WebUI to get a web interface. To do this, run the command 

$ podman machine start, then 

$ podman run -d -p 3000:8080 --network slirp4netns:allow_host_loopback=true -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main.

This will start the Open-WebUI container and map port 3000 on the host to port 8080 in the container, allowing incoming HTTP traffic on port 3000 to be forwarded to the container. Now, open your browser and navigate to http://localhost:3000 to access the web interface. 


To validate how my local LLM environment works, I used the above podman run command as an input to see, whether it can explain. So my simple prompt was;

Input: 

Explain me the following command.

podman run -d -p 3000:8080 --network slirp4netns:allow_host_loopback=true -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main 


And here is the response! What would be your reaction on the response?

Response: 

The podman run command is a Docker-like command for running containers in the Podman environment. Here's a breakdown of the options used in the command you provided:
  • -d: Run the container in detached mode, meaning it will run in the background and not interact with the terminal. 
  • -p 3000:8080: Map port 3000 on the host to port 8080 in the container, allowing incoming HTTP traffic on port 3000 to be forwarded to the container.
  • --network slirp4netns:allow_host_loopback=true: Use the slirp4netns network plugin, which allows for host-to-container loopback connections. This is useful when developing applications that need to communicate with other containers or the host machine.
  • -v open-webui:/app/backend/data: Mount a volume from the open-webui directory inside the container to the /app/backend/data directory on the host. This allows data to be shared between the container and the host.
  • --name open-webui: Set the name of the container.
  • -restart always ghcr.io/open-webui/open-webui:main: Restart the container if it crashes or is terminated, using the ghcr.io/open-webui/open-webui:main image. The :main part of the image name indicates that this is the main image for the application. 
The ghcr.io domain is a container registry service provided by Google Cloud. It allows you to store and manage Docker images, including the open-webui image used in the command. 
In summary, the command runs a container using the slirp4netns network plugin, maps port 3000 on the host to port 8080 in the container, mounts a volume from the open-webui directory inside the container to the host's /app/backend/data directory, sets the name of the container, and restarts the container if it crashes or is terminated using the ghcr.io/open-webui/open-webui:main image.

Pretty cool, right?

  • Ollama - https://github.com/ollama/ollama
  • Open-WebUI (formally known as Ollama-webui) - https://github.com/open-webui/open-webui
Btw, I came across another local LLM studio for "discover, download, and run local LLMs" as well: https://lmstudio.ai/, fast moving space uh?


Some podman related commands that you may need to use for any needed debugging.
  • podman machine list
  • podman machine stop
  • podman machine start
  • podman container list
  • podman container rm open-webui
  • ollama serve
  • lsof -i:3000


Monday, August 29, 2022

My 2nd son has been starting this blog/forum: https://highschoolstudyhel.wixsite.com/amasite to help high school students. 

This website will help you revising/studying by answering your questions. Currently, this site can answer questions about IGCSE Mathematics, Co-ordinated science, Economics, Global Perspectives, DT (RM), AP US History, Chemistry, Biology, Macroeconomics. If you have any questions, just take a photo of your question, and post in on the forum page.


Good start!

Friday, February 15, 2019

테크트렌드인사이트 2018 - 정창우 전무, 클라우드 네이티브

2018 테크트렌드를 말한다...블록체인-AI발 생태계 격변

테크M, 테크트렌드인사이트2018 컨퍼런스 개최...분야별 전문가 전망 공유


 황치규 기자
 2017.11.30



      [테크M=황치규 기자] "2018년 기술로 인한 산업 생태계의 변화는 더욱 거세질 것이다. 다양한 분야에서 비즈니스의 본질이 바뀌고, 신기술을 활용한 서비스 모델들도 쏟아질 것이다."
      29일 머니투데이방송 테크M이 개최한 테크트렌드인사이트2018 컨퍼런스에선 블록체인, 인공지능, 커넥티드카, 보이스 플랫폼, 클라우드, 증강현실 기술이 국내외 ICT 시장에 미칠 영향에 대한 전문가들의 전망이 공유됐다. 
      특히 블록체인과 인공지능이 내년에 중량감 있는 기술 키워드가 될 것이라는 전망이 많아 주목된다.
      블록체인과 관련해서는 올해는 개념검증(PoC) 성격의 프로젝트가 많았지만 내년초를 기점으로 컨설팅과 구축 사업이 확산될 것으로 예상됐다.
      테크트렌드인사이트2018에서 블록체인노믹스를 주제로 발표한 SK주식회사 C&C의 오세현 전무는 "내년초부터는 블록체인 관련 컨설팅과 SI 프로젝트가 늘어나고 블록체인을 솔루션화하는 회사들도 나올 것이다"고 전망했다.
      오 전무에 따르면 블록체인은 광범위한 분야에 적용될 수 있는 잠재력을 갖췄다. 이미 금융은 물론이고 콘텐츠, 광고, 유통 분야도 파고들고 있다. 오세현 전무는 "블록체인이 만능 기술은 아니지만 중간자들이 있고 신뢰를 필요로하는 모든 분야에 영향을 미칠 수 있다"고 말했다. 블록체인을 통해 거래의 신뢰성과 투명성을 강화할 수 있다는 것이 오 전무 설명이다.
      블록체인 PoC를 해본 기업들이 실제 프로젝트로 시작하는데 있어 걸림돌은 기술이 아니다. 처음 해보는 것이라는 불안감이 더욱 큰 장벽이다. AI나 빅데이터와 달리 블록체인은 세계 각국이 비슷한 속도로 움직이다 보니 참고할만한 레퍼런스가 많지 않아, 국내 기업들이 부담을 가질 수 있다는 것이다. 그런만큼 기업들은 블록체인이 각자의 사업에 어떤 도움이 될지를 스스로 판단할 필요가 있다고 오 전무는 강조했다.
      AI의 경우 다양한 분야에서 업의 본질을 바꾸고 있고, 그 속도는 내년에 더욱 가속화될 것으로 예상됐다. AI 관련 발표를 진행한 인치원 카카오브레인 CSO는 "테슬라는 자신들의 강점을 자율주행 알고리즘이라고 말하고, GE는 공장에서 발생하는 데이터를 수익을 내는 회사라 하고 있다"면서 "AI로 인해 업의 생명 주기가 짧아지고 있다. 조만간 많은 분야에서 AI로 인해 업의 본질이 변화할 것이다"고 말했다.
      인치원 CSO에 따르면 AI 알고리즘은 최근들어 진화에 진화를 거듭하고 있다. 미국에 이어 중국도 AI 강국 반열에 올라섰다. 특히 중국은 거대한 데이터와 국가 차원을 등에 업고 미국을 위협하는 AI 역량 확보에 속도를 내고 있다.
      규모로 미국이나 중국계 업체와 겨룰 수 없는 국내 기업이 AI로 경쟁력을 갖기 위해서는 어떻게 해야할까?
      인치원 CSO는 제휴를 통해 규모를 키워야 한다고 강조했다. 카카오가 개발한 AI 엔진을 삼성전자 스마트폰, LG전자 가전, 현대자동차, SK하이닉스 반도체 등 글로벌 시장에서 입지가 강한 하드웨어 탑재하는 것이 중요하다는게 그의 설명이다.
      인치원 CSO는 "글로벌 AI 시장은 이미 규모의 경쟁에 돌입했다"면서 "카카오브레인은 제휴를 확대할 수 있는 오픈플랫폼을 제공하고 있다"고 말했다.
      커넥티드카 서비스는 ETRI의 최정단 자율주행시스템연구그룹장이 발표를 맡았다. 그에 따르면 커넥티드카 서비스는 현재 기능안전, 보안과 효율적인 이동 서비스를 제공하는데 초점이 맞춰져 있다. 이를 기반으로 자율주행을 향해 진화하고 있다. 
      최 단장에 따르면 지율주행을 위해서는 다양한 네트워크 기술 발전으로 데이터와 클라우드에의 접근 확대, 연결성과 시스템 보안, 사용자 인증, 사용자 인터페이스와 응용 프로그램, 센서 고집적 솔루션, 멀티코어, 저전력, 저발열 시스템 등의 기술이 갖춰져야 한다. 또 범부처 협력 및 민간의 개방 정책이 필요하다고 최 단장은 강조했다.
      보이스 플랫폼도 2018년 보다 존재감을 키울 것으로 전망된다. 황성재 퓨처플레이 파트너는 "아마존 알렉사를 탑재한 하드웨어 채널이 하나 늘어나면 아마존 소비자 구매가 10% 늘어나고 있다"면서 "내년에는 아마존 에코처럼 음성 인식 SW를 탑재한 하드웨어들이 더욱 늘어날 것이다"고 말했다.
      클라우드의 경우 클라우드 인프라 장점에 맞춰 애플리케이션을 개발하는 트렌드가 강조됐다. 마이크로서비스도 키워드로 꼽혔다. 발표를 맡은 IBM 아태지역 클라우드 담당 정창우 전무는 "마이크로서비스는 조각조각 나눠서 애플리케이션을 개발하는 방식"이라며 "기존에 한번에 개발하는 것과 비교해 특정 서비스만 확장하거나 수정을 적용하는데 용이하다"고 말했다.
      증강현실와 관련해서는 공유 플랫폼이 강조됐다. 발표를 맡은  우운택 KAIST 교수는 "내년에는 저작된 가상 및 증강현실 콘텐츠를 공유하는 플랫폼에 대한 관심이 커질 것이다"면서 공유 플랫폼으로서 3차원 지도에 대한 중요성이 커질 것으로 내다봤다.
      [테크M=황치규 기자(delight@techm.kr)]

      Sunday, October 1, 2017

      AI컨퍼런스_정창우 상무 인터뷰

      시사저널e는 오는 25일 서울 삼성동 코엑스에서 열리는 ‘AI, 현재가 된 미래의 삶, 인공지능이 바꾼 일상 & 비즈니스라는 주제로 제3회 인공지능 컨퍼런스 를 개최한다. 이 자리에 연사로 나설 정창우 한국IBM 연구소장(상무)을 만나 인공지능의 현재와 미래를 들어봤다
      #ibmaot