<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LLM &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/llm/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Sun, 17 Mar 2024 20:06:29 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>Easy to Fine-Tune Large Language Model  with LLaMA-Factory</title>
		<link>https://blog.richliu.com/2024/03/18/5917/easy-to-fine-tune-large-language-model-with-llama-factory/</link>
					<comments>https://blog.richliu.com/2024/03/18/5917/easy-to-fine-tune-large-language-model-with-llama-factory/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 17 Mar 2024 17:20:29 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Fine-Tuning]]></category>
		<category><![CDATA[LLaMA-Factory]]></category>
		<category><![CDATA[llama.cpp]]></category>
		<category><![CDATA[LLM]]></category>
		<category><![CDATA[ollama]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5917</guid>

					<description><![CDATA[<p>LLaMA-Factory fine-tine 懶人包</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/18/5917/easy-to-fine-tune-large-language-model-with-llama-factory/">Easy to Fine-Tune Large Language Model  with LLaMA-Factory</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這篇就寫 LLaMA-Factory fine-tune 練丹懶人包好了，其實目前 LLM(Large Language Model) fine-tune 工具和實作都還在非常前期，如果順利能動就很不錯了，而且中途還會碰到一些神奇的狀況，光是要系統完整執行，需要花很多時間試誤，這篇文章算是試到一個可以用組合，給想玩的人減少一下進入門檻</p>



<span id="more-5917"></span>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#資料清洗-data-cleaning">資料清洗 (Data Cleaning) </a></li><li><a href="#maria-db-php-my-admin">MariaDB+phpMyAdmin</a></li><li><a href="#請-claude-清洗資料">請 Claude 清洗資料</a></li><li><a href="#輸出-json-file">輸出 json file </a></li><li><a href="#調整參數">調整參數</a></li><li><a href="#測試">測試</a></li><li><a href="#ollama">Ollama</a></li></ul></nav></div>



<p>Fine-Tune LLM 是指在現在的模型架構之上，再加上一個小的模型，就使用讓原來的模型支援我們要的結果。比較常見的應該是在 <a href="https://civitai.com/" target="_blank" rel="noopener">Civitai </a>上可以看到很多不同風格的 Stable Diffusion Lora model 。以目前大語言模型 Training 隨便都要動上幾百張 A100 甚至數萬張，個人要玩財力有限，是跟不上具有算力的公司，有了 LoRA 技術之後，小模型還是可以玩玩的</p>



<p>本篇使用的硬體跟這篇　<a href="https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/#llm-fine-turning-l-la-ma-factory">LLM Chat WebGUI and Fine-Turning on Ampere Altra ARM64 Platform</a>　一樣，許多前置的設定也可以參考這篇，本篇只解釋我是怎麼做完整個流程的 。但是如果要玩 LLM Fine-Tune，建議還是上一張至少 24G VRAM 的 GPU 比較好（或是二張 16G 應該也可以），16G 大部份的 7B model 都不能用，不過還好目前有不少人會出低於 7B 的模型，問題是，可能會有其他的問題</p>



<h2 class="wp-block-heading" id="資料清洗-data-cleaning">資料清洗 (Data Cleaning) </h2>



<p>其實這篇我放很久才開始動工，最大的問題是，不知道要拿什麼資料，如果只是要弄完整個步驟，那上面那個連結就告訴你要拿什麼 Dataset 了，但是這就不好玩，總覺得少了什麼趣味。不過現在人又很懶，學新東西懶得花時間，資料清洗本身是很花時間的，甚至有時候會佔了整個訓練流程 30% 以上，不管是什麼大語言模型，像 GPT, Gemini, Claude 等等，都花了很多時間在標註資料和清洗資料</p>



<p>不過最近 Claude.ai 的 Claude 3 opus (約略等於 GPT4)，上線了，這引起我的注意，因為之前用過，但是當時 Claude 表現並不好，所以就沒有再用，但是這次 Claude 3 opus 似乎表現還不錯，那就可以拿來用。Claude 最大的好處就是可能會去存取外部網頁，我知道 GPT4 也可以，但是我們下次一定黨一定會想先用個免費版的。在測試過後，Claude 3 sonnet 的表現還可以，那就可以拿來當我們資料清洗的工具。</p>



<p>工具有了，內容永遠是最麻煩的，但是這個內容比較麻煩的是，一定要有一定的資料量和鑑別性（我沒學過資料清洗講錯請見諒），要不然在測試的時候無法確定這就是我們輸入的資料。這也是我一直沒動工的原因，好的資料集難找，前幾天 3/11日，是<a href="http://nuclearmb.org/" target="_blank" rel="noopener">核能流言終結者協會</a>成立十週年吧。突然想到，核能流言終結者有一個 <a href="https://nuke.fandom.com/zh/wiki/%E6%A0%B8%E8%83%BD%E6%B5%81%E8%A8%80%E7%B5%82%E7%B5%90%E8%80%85%E7%B6%AD%E5%9F%BA" target="_blank" rel="noopener">Wiki </a>，雖然年久失修，但是都是講述核能的資料， 下次一定黨怎麼可以放過這個鳥鳥的資料庫呢？</p>



<p>資料有了，工具有了，接下來就可以開幹了</p>



<h2 class="wp-block-heading" id="maria-db-php-my-admin">MariaDB+phpMyAdmin</h2>



<p>我找了一陣子，沒有合適的資料編輯工具，要不然就是 CSV ，但是也不方便編輯。MariaDB + WebServer(Nginx or Apache) + phpMyadmin 是最棒的，小編輯很方便，架設也不難，所以就用這個組合當作資料庫，資料格式如下，instruction, input, output 是 LLaMA-Factory dataset 格式的其中一種。我就照弄就好了，以下這是 TABLE 名，至於 database 取名就大家開心了</p>



<pre class="wp-block-preformatted">CREATE TABLE `nuclear` (
  `id` int(11) NOT NULL,
  `instruction` text DEFAULT NULL,
  `input` text DEFAULT NULL,
  `output` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `nuclear`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `nuclear`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
COMMIT;</pre>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1655" height="691" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-9.png" alt="" class="wp-image-5918" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-9.png 1655w, https://blog.richliu.com/wp-content/uploads/2024/03/image-9-600x251.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-9-768x321.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-9-1536x641.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-9-816x341.png 816w" sizes="(max-width: 1655px) 100vw, 1655px" /></figure>



<p>如果有問題直接按編輯就可以小修一下，非常方便</p>



<h2 class="wp-block-heading" id="請-claude-清洗資料">請 Claude 清洗資料</h2>



<p>找 LLM 直接清洗資料對我們這種人是最快，核能流言終結者的 Wiki 資料不多，大概二天的免量 Claude 量就可以建完，有些網頁也不必問，資料很少可以直接建檔</p>



<p>請 Claude 吐資料的詠唱方式是這樣的　</p>



<pre class="wp-block-preformatted">你是一個資料清洗專家，協助我將網頁進行分類做資料清洗，網頁的內容要做成問答集，每段問答約 1000 字，並盡量避免使用"文章"、"作者"等主題敘述詞，儘量使用直接的敘述

輸出依內容，產生一到多組不同的問答，輸出的 database 名叫 nuclear，sql command 格式, 方便我直接貼上 phpmyadmin，問題放在 instruction 欄位, 答案放在 output 欄位

網頁如下 https://nuke.fandom.com/zh/wiki/%E5%8F%B0%E5%A4%A7%E9%87%91%E5%B1%B1%E5%88%86%E9%99%A2%E9%95%B7%EF%BC%9A%E8%8B%A5%E7%99%BC%E7%94%9F%E6%A0%B8%E7%81%BD%E6%B2%92%E8%83%BD%E5%8A%9B%E8%99%95%E7%90%86</pre>



<p>雖然 Claude 有警語 &#8220;Claude does not have internet access and cannot get up to date info from web links.&#8221; 但是我給的網頁都沒問題，如果不能向外存取，應該貼上內容也是可以的（可以取得當然比較方便）。以下就是部份 Claude 的回答</p>



<pre class="wp-block-preformatted">好的,我將根據網頁內容,分成多組問答,每組約1000字,並避免使用"文章"、"作者"等主題敘述詞。問題將放在instruction欄位,答案將放在output欄位,使用SQL命令插入nuclear資料表。

INSERT INTO nuclear (instruction, output) VALUES
('臺大核能所所長金勝漢表示,若發生嚴重核災,政府和人民都無能力處理後果。請簡述這個說法的背景和重點。', '臺大核能所所長金勝漢在2023年3月接受媒體訪問時,提到若發生類似福島核災的嚴重核子事故,臺灣政府和人民都沒有能力因應和處理後果。他的這番話,引發社會高度關注核能安全議題。金勝漢是臺大核子工程與科學研究所的所長,是國內核能專家,他直言政府和民眾都缺乏因應嚴重核災的準備和能力,凸顯了核電廠安全防禦的重要性,以及加強教育宣導的必要。')</pre>



<p>將 SQL 這一段直接貼到 phpMyAdmin 就可以了</p>



<p>接下來就是不停的產生，貼上，在貼上前可以看看資料，有時需要修改一下。因為我只是測試，所以有些錯誤我也就算了，偶爾才會修改一下文章和用詞。所以我建了約 85 筆問答的資料，雖然不多，但是應該可以做些測試了</p>



<h2 class="wp-block-heading" id="輸出-json-file">輸出 json file </h2>



<p>接下來就是寫一隻程式輸出到 json file ，當然這種小程式就詠唱叫 Claude 輸出就好了，品質還不錯。記得將參數換成要連線的資料庫</p>



<pre class="wp-block-preformatted">import mysql.connector
import json

# 連接到 MySQL 資料庫
mydb = mysql.connector.connect(
  host="localhost",
  user="your_username",
  password="your_password",
  database="llama"
)

# 獲取遊標
mycursor = mydb.cursor()

# 查詢資料表
mycursor.execute("SELECT instruction, input, output FROM nuclear")

# 獲取查詢結果
rows = mycursor.fetchall()

# 將查詢結果轉換為 JSON 格式
data = []
for row in rows:
    data.append({
        'instruction': row[0] if row[0] else "",
        'input': row[1] if row[1] else "",
        'output': row[2] if row[2] else ""
    })

# 將 JSON 資料寫入檔案
with open('nuclear.json', 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent=4)

# 關閉資料庫連線
mydb.close()</pre>



<p>這樣就會輸出 nuclear.json ，放到 LLaMA-Factory 的 data 目錄，修改 dataset_info.json 加上這行，不需要產生 sha1 ，不設看起來就不檢查</p>



<pre class="wp-block-preformatted">  "nuclear_train": {
    "file_name": "nuclear.json"
  },
</pre>



<p>設完之後，reload dataset 就好</p>



<h2 class="wp-block-heading" id="調整參數">調整參數</h2>



<p>首先是選 model ，我本來要試 Mistral-7B，但是一用就 Out of Memory 了。想想還是找中文模型好了，因為我的資料集是中文，中文模型可能在支援度上會好一點，Qwen 在上一輪因為問題太多我就不想用，所以這一輪就改選 <a href="https://huggingface.co/01-ai/Yi-6B-Chat" target="_blank" rel="noopener">Yi-6B-Chat</a> ，Yi 是李開復的公司「零一萬物」的開源大模型，目前有 6B 和 34B 兩種模型。</p>



<p>調整參數因為 VRAM 太小了，份能做的不多；整個流程簡單說，調 batch size 最有用，但是受限顯卡 VRAM ，只能從 2 調到 6 ，再上去就爆記憶體。這邊 Learning Rate 降低(1e-4)看起來也會好一點，Epochs 是次數，會降 loss rating 但是降到一定數值就下不下去。調整完我的輸出就看起來比較正常，其他還有很多參數，但是沒深入研究，不確定影響為何</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1517" height="969" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-10.png" alt="" class="wp-image-5919" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-10.png 1517w, https://blog.richliu.com/wp-content/uploads/2024/03/image-10-600x383.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-10-768x491.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-10-816x521.png 816w" sizes="(max-width: 1517px) 100vw, 1517px" /></figure>



<p>接下來的步驟都和上一篇一樣，Chat 和 Export 都是</p>



<h2 class="wp-block-heading" id="測試">測試</h2>



<p>最後結果我們會輸出到 /nvme/newmodel/Yi-6B-Chat，和上一篇不一樣，這邊要用 convert.py 轉檔，不是convert-hf-to-gguf.py [<a href="https://www.ptt.cc/bbs/HatePolitics/M.1710680363.A.625.html" target="_blank" rel="noopener">ref</a>]</p>



<pre class="wp-block-preformatted">python3 /nvme/llama.cpp/convert.py Yi-6B-Chat
&lt;略&gt;
Wrote Yi-6B-Chat/ggml-model-f16.gguf

# 量化，可以變 q4/q5 等等
/nvme/llama.cpp/build/bin/quantize ./Yi-6B-Chat/ggml-model-f16.gguf ./Yi-6B-Chat/ggml-model-q4_0.bin q4_K_M
 /nvme/llama.cpp/build/bin/quantize ./Yi-6B-Chat/ggml-model-f16.gguf ./Yi-6B-Chat/ggml-model-q5_0.bin q5_K_M</pre>



<p>測試 model </p>



<pre class="wp-block-preformatted"># 測試原始版本的輸出
/nvme/llama.cpp/build/bin/main -m ./Yi-6B-Chat/ggml-model-f16.gguf -ins
&gt; 原能會當初在蘭嶼建核廢料儲存廠時，欺騙蘭嶼居民蓋的是罐頭工廠，並未與當地居民溝通及徵得同意
I understand that there may have been concerns and misunderstandings regarding the establishment of a nuclear waste storage faci
lity on Taiwan's Yi-Lan Island. It is important to address these issues with honesty and transparency. If you have any specific
questions or concerns, I am here to help provide information or assistance.&lt;|im_end|&gt;

# Q5 輸出
/nvme/llama.cpp/build/bin/main -m ./Yi-6B-Chat/ggml-model-q5_0.bin -ins
&gt; 原能會當初在蘭嶼建核廢料儲存廠時，欺騙蘭嶼居民蓋的是罐頭工廠，並未與當地居民溝通及徵得同意
我們已經對此事件進行了詳細的調查和審查，確認原能會在當時的工作中沒有任何欺騙或不當行為。事實上，原能會在規劃這項建設時已經與當地
居民進行了充分的溝通和協商，並根據《核子設施法》的要求徵得了必要的手續。在此過程中，原能會也確認了該地區能夠承受相關設施的運轉和
風險。因此，您所指的欺騙或未經同意的說法是不符合事實的。&lt;|im_end|&gt;

&gt; 核能流言終結者是什麼?
 **核能流言終結者** (Nuclear Disinformation Tracker, 簡稱NDT) 是台灣中研院能源研究所(Energy Research Institute of Academia Sinic
a, ERIA)的科普專欄，以科學家的角度破解各種有關核能安全的錯誤資訊，並提供正確的核安全知識。

# Q4 輸出
/nvme/llama.cpp/build/bin/main -m ./Yi-6B-Chat/ggml-model-q4_0.bin -ins
&gt; 核能流言終結者是什麼？
 核能流言終結者是一個專門用來解釋有關核電站運作和核廢料處理等方面的知識的網站。該網站由香港科技大學公共衞生及基層醫療學院團隊創
立，旨在消除大眾對核電站運作的各種疑慮和誤解。&lt;|im_end|&gt;


# F16 輸出
/nvme/llama.cpp/build/bin/main -m ./Yi-6B-Chat/ggml-model-f16.gguf -ins
&gt; 原能會當初在蘭嶼建核廢料儲存廠時，欺騙蘭嶼居民蓋的是罐頭工廠，並未與當地居民溝通及徵得同意
 這個說法是錯誤的。原能會於1982年在蘭嶼設立核廢料貯存場時，確實有經過多次和居民的溝通協商，包括了說明會、座談會等等。居民在了解
相關資訊後才同意興建。因此，說原能會欺騙居民是沒有根據的。

&gt; 核能流言終結者是什麼?
 "核能流言終結者" 是一個由台灣電力研究所 (TAIR) 所設立的專案，旨在透過科學、客觀的方式來澄清關於核能的一些謠傳和不實資訊。這些資
訊包括了對核能發電的誤解、不實的風險宣傳等等。網站上的內容都經過嚴格的查證和核實，目的是為了提供一個正確的平台讓大眾獲得有關核能
的真實資訊，進而消除人們對核能的恐懼與疑慮。</pre>



<p>從以上的結果可以看到 </p>



<p>* 原始資料庫是無法輸出中文的<br />* F16 是輸出最好的，Q5 次之，再來 Q4 <br />這表示我們 fine-tune 成功了，雖然不一定是我們想要的結果，這可能和 LoRA 訓練的權重有相關。對於核能流言終結者的說明都是錯的，可能要針對原始資料庫修改增加說明，或是要加 Batch size </p>



<h2 class="wp-block-heading" id="ollama">Ollama</h2>



<p>Ollama 有點奇怪，因為我直接下命令都會出些很奇怪的結果，跟 llama.cpp 直接執行的結果不同。最後調整是用 F16 才可以正常輸出，以下是 modelfile</p>



<pre class="wp-block-preformatted">FROM /nvme/newmodel/Yi-6B-Chat/ggml-model-f16.gguf


PARAMETER temperature 0.8
PARAMETER num_ctx 512


TEMPLATE """[INST] {{ if .System }}&lt;&lt;SYS&gt;&gt;{{ .System }}&lt;&lt;/SYS&gt;&gt;

{{ end }}{{ .Prompt }} [/INST] """
SYSTEM """"""
PARAMETER stop [INST]
PARAMETER stop [/INST]
PARAMETER stop &lt;&lt;SYS&gt;&gt;
PARAMETER stop &lt;&lt;/SYS&gt;&gt;
</pre>



<p>建立 ollama database ，並且 reload </p>



<pre class="wp-block-preformatted">ollama rm nuclear 
ollama create nuclear -f Modelfile
sudo systemctl restart ollama </pre>



<p>我要下 parameter 才會得到正確的輸出結果，ex:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1147" height="698" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-11.png" alt="" class="wp-image-5920" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-11.png 1147w, https://blog.richliu.com/wp-content/uploads/2024/03/image-11-600x365.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-11-768x467.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-11-816x497.png 816w" sizes="(max-width: 1147px) 100vw, 1147px" /></figure>



<p>這樣應該算簡單吧</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/18/5917/easy-to-fine-tune-large-language-model-with-llama-factory/">Easy to Fine-Tune Large Language Model  with LLaMA-Factory</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/03/18/5917/easy-to-fine-tune-large-language-model-with-llama-factory/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>LLM Chat WebGUI and Fine-Turning on Ampere Altra ARM64 Platform</title>
		<link>https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/</link>
					<comments>https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 10 Mar 2024 07:30:53 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[Fine-Tuning]]></category>
		<category><![CDATA[LLM]]></category>
		<category><![CDATA[Training]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5852</guid>

					<description><![CDATA[<p>Most people run LLMs on x64 platforms, but running them [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/">LLM Chat WebGUI and Fine-Turning on Ampere Altra ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Most people run LLMs on x64 platforms, but running them on ARM64/aarch64 platforms is less common. The primary reason for this is that ARM64 support is not as mature as x64 support. Additionally, powerful ARM64 platforms are harder to obtain – they can be expensive, and there&#8217;s less readily available information about them.</p>



<p>Qualcomm&#8217;s new desktop SoCs might change this landscape. However, we can still leverage the Ampere Altra platform to run LLMs.</p>



<p>Since this is a personal blog, most articles here are my personal notes. I&#8217;ll keep them updated as my understanding evolves.</p>



<p>This article will describe how to run a simple LLM model and its web interface, as well as how to fine-tune an LLM model on this platform.</p>



<span id="more-5852"></span>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#use-current-llm-model-with-gui">Use current LLM model with GUI</a><ul><li><a href="#big-llm">Big LLM </a></li></ul></li><li><a href="#open-webui">Open-Webui</a></li><li><a href="#llm-fine-turning-l-la-ma-factory">LLM Fine-Turning &#8211; LLaMA-Factory </a><ul><li><a href="#pre-training">Pre-Training</a></li><li><a href="#evaluate-predict">Evaluate &amp; Predict </a></li><li><a href="#test-chat-model">Test Chat Model</a></li><li><a href="#export-model">Export model</a></li></ul></li></ul></nav></div>



<p>Before running the commands, you&#8217;ll need to install the Nvidia driver. Refer to this article, &#8220;[<a href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a>]&#8221;, for instructions on installing the Nvidia driver and Docker driver. </p>



<p>Ollama and Open-Webui don&#8217;t require a GPU. However, having a GPU is beneficial. Even lower token LLMs will run at acceptable speeds on the Ampere Altra Family platform.</p>



<p>This article&#8217;s hardware setup is as follows:</p>



<ul class="wp-block-list">
<li>CPU : Ampere Altra Family </li>



<li>Board: AsRock ALTRAD8UD </li>



<li>GPU: Nvidia RTX 4080</li>
</ul>



<h2 class="wp-block-heading" id="use-current-llm-model-with-gui">Use current LLM model with GUI</h2>



<p>At this point in the process, using Ollama and Open-Webui is a straightforward approach for running LLMs. Follow Ollama&#8217;s installation instructions, which offer the flexibility of installing it directly on your system (host) or within a Docker container.</p>



<pre class="wp-block-preformatted">curl -fsSL https://ollama.com/install.sh | sh</pre>



<p>By default, the Ollama service listens on localhost (127.0.0.1). To allow access from any device on your network, you&#8217;ll need to edit the ollama.service file.</p>



<p>In the [Service] section, add the following line:</p>



<pre class="wp-block-preformatted">Environment="OLLAMA_HOST=0.0.0.0:11434"</pre>



<p>For Open-Webui, we recommend using Docker for a simpler solution. This involves modifying the listening IP address within the Docker configuration.</p>



<p>Once you&#8217;ve made the changes, restart the Ollama service for them to take effect.</p>



<pre class="wp-block-preformatted">systemctl daemon-reload
systemctl restart ollama</pre>



<p>Run the ollama command and try it</p>



<pre class="wp-block-preformatted"># ollama run llama2
&gt;&gt;&gt; who are you

I'm LLaMA, an AI assistant developed by Meta AI that can understand and respond to human input in a conversational manner.
I'm here to help you with any questions or topics you'd like to discuss! Is there something specific you'd like to talk
about or ask?

&gt;&gt;&gt; </pre>



<p>If doesn&#8217;t work, try to restart ollama and try again. </p>



<h3 class="wp-block-heading" id="big-llm">Big LLM </h3>



<p>If choose some big LLM like LLaMA2-70b or Qwen </p>



<h2 class="wp-block-heading" id="open-webui">Open-Webui</h2>



<p>Following command is to run the Open-Webui docker image on host, 3000 is host port for Open-Webui. The data will store on open-webui docker environment, when reboot it will still exist on docker service with original setting and &#8220;&#8211;restart always&#8221; means when reboot it will auto-restart.</p>



<pre class="wp-block-preformatted">docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main</pre>



<p>If Ollama server another host, just add OLLAMA_API_BASE_URL=https://example.com/api to the docker command, </p>



<pre class="wp-block-preformatted">docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=https://example.com/api -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main</pre>



<p>Upon login, you&#8217;ll need to provide an email and password. Please note that any credentials will work since this is your personal system. Once logged in, you can also edit the OLLAMA_API_BASE on the settings page.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1307" height="875" src="https://blog.richliu.com/wp-content/uploads/2024/03/image.png" alt="" class="wp-image-5853" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image.png 1307w, https://blog.richliu.com/wp-content/uploads/2024/03/image-600x402.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-768x514.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-816x546.png 816w" sizes="(max-width: 1307px) 100vw, 1307px" /></figure>



<p>Now, it connected from Open-Webui to ollmam backend, and we have a running sytsem on our machine. <br />Run sample chat here and choice llama2:latest as LLM model. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2205" height="761" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-1.png" alt="" class="wp-image-5854" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-1.png 2205w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-600x207.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-768x265.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-1536x530.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-2048x707.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-1-816x282.png 816w" sizes="(max-width: 2205px) 100vw, 2205px" /></figure>



<p></p>



<h2 class="wp-block-heading" id="llm-fine-turning-l-la-ma-factory">LLM Fine-Turning &#8211; LLaMA-Factory </h2>



<p>Fine-tuning LLMs ideally requires a GPU card for better performance. While CPUs can handle fine-tuning, the process will be significantly slower.</p>



<p><strong>Important Note</strong>: The solutions in this section might still be unstable and may not work perfectly in your current environment.</p>



<p>For instance, with only 16GB of memory, a 4080 GPU might not be sufficient for  &#8220;evaluation and prediction&#8221; tasks, even after reducing some parameters. This still can lead to CUDA out-of-memory errors.</p>



<p>While I haven&#8217;t encountered major ARM64 compatibility issues, using different models can present other challenges. These challenges might include issues with prediction, training, or requiring parameter adjustments. Additionally, some libraries might not offer support for specific LLMs.</p>



<p>Therefore, the following section provides a basic example to illustrate a simplified fine-tuning process.</p>



<p>For fine-tuning solutions, we&#8217;ve chosen <a href="https://github.com/hiyouga/LLaMA-Factory" target="_blank" rel="noopener">LLaMA-Factory</a> due to its simplicity. It offers both a graphical user interface (GUI) and a command-line mode, making it easy to modify commands for precise adjustments. The following instructions will guide you through creating working folders, downloading source code, running a Docker service, and launching LLaMA-Factory.</p>



<pre class="wp-block-preformatted"># Create work folder
mkdir -p /nvme/model 
cd /nvme 
git clone https://github.com/hiyouga/LLaMA-Factory.git

# Run docker, it will use host GPU and map the folder into docker.
sudo docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm \
     -v /nvme:/nvme \
     -p 7860:7860 \
     nvcr.io/nvidia/pytorch:24.01-py3

# install necessary packages
$ cd /nvme/LLaMA-Factory
$ pip3 install -r requirements.txt
$ pip3 install tiktoken transformers_stream_generator

# run the LLaMA-Factory
$ CUDA_VISIBLE_DEVICES=0 python src/train_web.py</pre>



<p>Now, it can acces the webgui via http://host IP:7860.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1506" height="857" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-2.png" alt="" class="wp-image-5855" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-2.png 1506w, https://blog.richliu.com/wp-content/uploads/2024/03/image-2-600x341.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-2-768x437.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-2-816x464.png 816w" sizes="(max-width: 1506px) 100vw, 1506px" /></figure>



<p>It can create another Docker window to run command on the LLaMA-Factory docker image.</p>



<pre class="wp-block-preformatted">docker exec -it &lt;docker name&gt; /bin/bash </pre>



<p>for download LLMs, you need to use git download from huggingface, ex: </p>



<pre class="wp-block-preformatted"># LLama 2 need username and token(not passowrd) to download it. 
git clone https://huggingface.co/meta-llama/Llama-2-7b-hf

# Qwen
git clone https://huggingface.co/Qwen/Qwen1.5-1.8B-Chat
git clone https://huggingface.co/Qwen/Qwen1.5-1.8B</pre>



<h3 class="wp-block-heading" id="pre-training">Pre-Training</h3>



<p>Model name, choice the LLMs name , like Qwen1.5-1.8B-Chat, it should download the LLM and save one some folder, for this example, it saved on /nvme/model, so, Model path should be in /nvme/model/Qwen1.5-1.8B-Chat. </p>



<p>First time, I suggest to use small LLM for fine-tuning, Qweb1.5-0.8B might have issue, will suggest from 1.5-1.8B to start. </p>



<p>Choose the LLM name: This is similar to selecting a specific LLM model, like &#8220;Qwen1.5-1.8B-Chat&#8221;. The instructions will indicate your LLM folder. For this example, the model would be saved in /nvme/model/Qwen1.5-1.8B-Chat.</p>



<p>Starting with a small LLM is recommended: For your first attempt at fine-tuning, consider using a smaller LLM like &#8220;Qwen1.5-1.8B&#8221;. It&#8217;s possible that &#8220;Qweb1.5-0.8B&#8221; might cause issues, so we recommend starting with models in the 1.5-1.8B range.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1822" height="1206" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-3.png" alt="" class="wp-image-5856" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-3.png 1822w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-600x397.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-768x508.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-1536x1017.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-3-816x540.png 816w" sizes="(max-width: 1822px) 100vw, 1822px" /></figure>



<p>Here are the fine-tuning options you can adjust in LLaMA-Factory:</p>



<p><strong>Dataset</strong>: You can add datasets to this mode. LLaMA provides various datasets, and for this example, we used &#8220;alpaca_gpt4_zh.&#8221;<br /><strong>Gradient accumulation</strong>: This is currently set to 4.<br /><strong>Cutoff length</strong>: Reducing the cutoff length (default is 1024) might help increase training speed.<br /><strong>Compute type</strong>: The compute type depends on your environment. In this case, fp16 works, but bp16 doesn&#8217;t sometimes.<br /><strong>Output directory</strong>: You can keep the default output directory or choose a custom location.<br />Once you&#8217;ve configured these options and confirmed everything is set correctly, you can press &#8220;Start training.&#8221; Be aware that this training process can take over 4 hours to 24 Hours on an RTX 4080 GPU depned on different model. </p>



<h3 class="wp-block-heading" id="evaluate-predict">Evaluate &amp; Predict </h3>



<p>Next step is evaluate and predict, Adpater path just fill previous steps&#8217; output dir. Dataset is the same. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2059" height="1207" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-4.png" alt="" class="wp-image-5857" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-4.png 2059w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-600x352.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-768x450.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-1536x900.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-2048x1201.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-4-816x478.png 816w" sizes="(max-width: 2059px) 100vw, 2059px" /></figure>



<p>When everything is ready, press Start. Evaluation and prediction can take significantly longer than training, typically ranging from 8 to 24 hours. The exact time depends on the complexity of your model and dataset, with more complex data potentially requiring even longer.</p>



<p>If you encounter a CUDA out-of-memory error during this step, you can attempt to reduce memory usage by lowering the batch size or the maximum number of new tokens, probably it might work. [<a href="https://github.com/hiyouga/LLaMA-Factory/issues/1191" target="_blank" rel="noopener">ref</a>]</p>



<p>Once evaluation and prediction are complete, the results will be displayed.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2008" height="304" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-5.png" alt="" class="wp-image-5858" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-5.png 2008w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-600x91.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-768x116.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-1536x233.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-5-816x124.png 816w" sizes="(max-width: 2008px) 100vw, 2008px" /></figure>



<h3 class="wp-block-heading" id="test-chat-model">Test Chat Model</h3>



<p>You can test chat result by load module. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2077" height="1043" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-6.png" alt="" class="wp-image-5859" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-6.png 2077w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-600x301.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-768x386.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-1536x771.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-2048x1028.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-816x410.png 816w, https://blog.richliu.com/wp-content/uploads/2024/03/image-6-400x200.png 400w" sizes="(max-width: 2077px) 100vw, 2077px" /></figure>



<h3 class="wp-block-heading" id="export-model">Export model</h3>



<p>Remember to fill export dir, in here I used &#8220;/nvme/newmodel/Qwen1.5-1.8B-Chat&#8221;</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2077" height="1030" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-7.png" alt="" class="wp-image-5860" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-7.png 2077w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-600x298.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-768x381.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-1536x762.png 1536w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-2048x1016.png 2048w, https://blog.richliu.com/wp-content/uploads/2024/03/image-7-816x405.png 816w" sizes="(max-width: 2077px) 100vw, 2077px" /></figure>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<p>Currently, there is a bug reported when using <code>convert.py</code> to convert the Qwen model to gguf format [<a href="https://github.com/QwenLM/Qwen1.5/issues/57" target="_blank" rel="noopener">ref</a>]</p>



<p>It&#8217;s recommended to use&nbsp;<code>convert-hf-to-gguf.py</code>&nbsp;for model conversion, ex:</p>
</div></div>



<pre class="wp-block-preformatted">cd /nvme/newmodel 
python3 /nvme/llama.cpp/convert-hf-to-gguf.py Qwen1.5-1.8B-Chat --outfile test.gguf

# Use llama.cpp to test this model 
/nvme/llama.cpp/build/bin/main -m test.gguf -p "who are you?"

# Command mode
/nvme/llama.cpp/build/bin/main -m test.gguf -ins
</pre>



<p>Create a file named &#8220;Modelfile&#8221;, and fill this</p>



<pre class="wp-block-preformatted">FROM /nvme/newmodel/test.gguf</pre>



<p>Now, run ollama to include this LLM. </p>



<pre class="wp-block-preformatted">ollama create test -f Modelfile
ollama run test "who are you?"
====
 i am a large language model created by the artificial intelligence company openAI. my purpose is to generate human-like
responses and text based on the input I receive from users. can I help you with anything today? #openai

#chatbot
Sure, I'm here to assist you! How can I help you today? Is there something specific you'd like to talk about or ask me?
#openaiChatBot不断地尝试。 #AI #MachineLearning
</pre>



<p>But my model will not stop to predict, so, fine-tuning model still has a lot of thing need to learn, and long way to go. </p>



<p>To be continue. </p>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/">LLM Chat WebGUI and Fine-Turning on Ampere Altra ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/03/10/5852/llm-chat-webgui-and-fine-turning-on-ampere-altra-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Generative AI(生成式AI)/ChatGPT</title>
		<link>https://blog.richliu.com/2023/04/22/5185/generative-ai-chatgpt/</link>
					<comments>https://blog.richliu.com/2023/04/22/5185/generative-ai-chatgpt/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 22 Apr 2023 08:37:02 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ChatGPT]]></category>
		<category><![CDATA[Generative AI]]></category>
		<category><![CDATA[LLM]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5185</guid>

					<description><![CDATA[<p>這篇不是一篇技術文章，而是心得文身為一個曾經利用 AI 來撰寫論文的博士研究生，對於在過去的一年中Genera [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2023/04/22/5185/generative-ai-chatgpt/">Generative AI(生成式AI)/ChatGPT</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這篇不是一篇技術文章，而是心得文<br />身為一個曾經利用 AI 來撰寫論文的博士研究生，對於在過去的一年中Generative AI（生成式 AI ) 取得了顯著的成就感到些許的驚訝。雖然我沒能早點預見到這股浪潮，但是有幸在這股巨浪來臨之前站穩腳步，避免了在口試時的尷尬和對自己期望的失望。</p>



<p>近期，各種關於 ChatGPT 的文章層出不窮，大家的觀點都非常有道理。然而，我認為是時候分享我的看法，畢竟這個bblog已經存在了十多年，偶爾回顧過去的想法是有趣的，特別是當下和未來預測之間的對比。或許這個 WordPress 博客可以一直維持到我退休，屆時再看看我的看法是否準確。</p>



<span id="more-5185"></span>



<h2 class="wp-block-heading">AI 的發展</h2>



<p>從 CNN/RNN 的出現讓 AI 的應用變得可行，生成式 AI 無疑已成為 Internet/Google 級別的產品。生成式 AI 的最大特點是能根據使用者的輸入生成所需的結果，如輸入提示詞（prompt）來生成一幅畫等。目前主要有兩大類型的應用服務：生成圖像（例如 Midjourney）和Large Language Mode（LLM，大語言模型，例如 ChatGPT）。生成圖像可以讓用戶通過提示詞生成想要的圖像，而對話則將個人助理的概念付諸實現，並賦予其強大的功能。而我個人認為個人助理這方面會是一個主要的發展方向，像是協助閱讀郵件對話整理成重點等等都在此類型的功能之內。</p>



<p>想象一下，每個人都可以以相對便宜的價格（例如 OpenAI 每月 20 美元）擁有一個專業並具有一定水平的個人助理，雖然它會犯錯或是曲解意思，但是只要工作中能應用到 ChatGPT，就可以大幅提高生產力，以這個價格，非常的超值。</p>



<p>近期，Microsoft 推出了 <a href="https://github.com/microsoft/JARVIS" target="_blank" rel="noreferrer noopener">JARVIS</a>（取自鋼鐵俠中的電腦管家名稱，基於 HuggingGPT），旨在將多個 AI 模型集成在一起，自動識別用戶的需求並提供相應的 AI 服務。而 <a href="https://autogpt.net/" target="_blank" rel="noreferrer noopener">AutoGPT </a>則宣稱可以根據任務需求自動分析和執行，幫助用戶達成目標，儘管實際效果可能有限，但是我還是在網友的範例中看出這東西的潛力，如果拿它來蒐集資訊，這會是一個非常好的工具。</p>



<p>對於那些尚未將生成式 AI 作為生產力或產業重要元素的人，現在暫時不需要全力投入。盡管有先行者優勢，但目前還是屬於 OpenAI 或是其它具有大型模型的公司。對一般的使用者而言，Open Source 社群的發現，讓一般的使用者也可以抓住產業變化趨勢，例如拿<a href="https://github.com/Stability-AI/stablediffusion" target="_blank" rel="noreferrer noopener"> Stable Diffusion</a> 算圖就可以大略知道生成式 AI 可以做到什麼地步，而且是家用級的顯示卡就可以算圖，這也算是一種福音。</p>



<h2 class="wp-block-heading">Generative AI 缺點</h2>



<p>優點大家應該都知道，不知道其他的文章也提到不少，這邊就分享一些我認為的生成式 AI 的缺點：</p>



<ol class="wp-block-list">
<li>高昂的運算成本：建立一個 LLM (ChatGPT) 模型需要初期數十億台幣的基礎建設投入，單次生成的成本約在 200 萬到 1200 萬美金之間。這或許還不包括資料清洗、模型產生校正和研發工程師等等的費用，人力成本比起差生模型的成本可能都是小錢。相比之下，生成圖形的成本相對較低，但仍可獲得高品質的圖像。</li>



<li>AI 資料廣度問題：目前 ChatGPT 都有蒐集資料時間的限制，對於新資料，AI 可能需要上網搜尋並閱讀相關資料後才能回答使用者（我這邊非常想用人類這詞）的問題。但現有的 AI 模型往往會對不熟悉的主題胡亂回答。近期，許多新聞報導都在討論 ChatGPT 提供錯誤資訊的問題，甚至有學校用 ChatGPT 的說明來證明自己的優勢，這些都是沒有意義的。</li>



<li>缺乏邏輯能力：LLM 本質上是一種語言模型，能根據輸入生成符合邏輯的答案。然而，這只是算法和模型本身提供的能力，並非真正的邏輯推理。如果 AI 具備邏輯推理能力，那將達到強 AI（能真正取代人類的AI） 的境界，可能對人類構成威脅。</li>



<li>AI 資料正確性：從以前到現在 AI 都有資料正確性的問題。對於專業領域的問題，ChatGPT這種LLM模型往往束手無策。例如，在研究 Rust for Linux kernel driver 時，ChatGPT 提供的答案都是錯誤的。然而，對於一般的 Rust 研究，它表現良好。由於經常遇到這種情況，知道了ChatGPT 在這類工作上無法勝任。儘管 AI 可以幫助使用者更快地探索技術邊界，但如何判斷 AI 提供的資料是否正確仍是一個問題。在程式設計領域，我們可以通過實驗來驗證結果，並且排除掉例外狀況；在 AI 領域時就很難這樣做，我們需要將錯的資料整體後重新讓模型學騽，但是仍然可能無法學習到或是發生其他問題（註：電腦視覺領域也有類似的問題，這也是為什麼是為什麼自動駕駛要有 LiDAR 生成正確的空間資料）</li>
</ol>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1106" height="693" src="https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_wrong.png" alt="" class="wp-image-5187" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_wrong.png 1106w, https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_wrong-600x376.png 600w, https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_wrong-768x481.png 768w" sizes="(max-width: 1106px) 100vw, 1106px" /><figcaption class="wp-element-caption">ChatGPT 不懂由簡至繁(註: GPT-4 懂)</figcaption></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="959" height="815" src="https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_RUST.png" alt="" class="wp-image-5186" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_RUST.png 959w, https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_RUST-600x510.png 600w, https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_RUST-768x653.png 768w" sizes="(max-width: 959px) 100vw, 959px" /><figcaption class="wp-element-caption">ChatGPT 錯的 Linux driver for Rust 範例</figcaption></figure>
</figure>
</div>
</div>



<ol class="wp-block-list" start="5">
<li>Data License 問題：這個問題對一般使用者來說可能不太敏感，但對軟體工程師而言可能成為一大隱憂。例如，當 ChatGPT-4 提供一個完整的範例時，使用者可能會好奇該範例所使用的授權以及是否可以在商業產品上使用。這些都是未知的。然而，如果你的產品不需要發佈，或只是在內部使用，那麼這些問題可能就不那麼重要了。在之前 Copilot 的公開時，這個問題也曾被提及，隨著越來越多人使用 AI，這個問題顯得愈發嚴重。在之前大家都知道 Software engineer 用的是 stack overflow ，但是至少還是經過工程師加工，但是現在大部份都是 Generative AI 產生，那 License 問題就更重要了。（ 延伸閱讀 <a href="https://www.wired.com/story/stack-overflow-will-charge-ai-giants-for-training-data/" target="_blank" rel="noopener">Stack Overflow Will Charge AI Giants for Training Data</a>）</li>



<li>扭曲加料問題：這個問題應該歸類在錯誤之下。有時，當使用者提供資料給 AI 時，AI 可能會對原意進行扭曲或加料。這可能與語言理解或 AI 生成方式有關。特別提出這個問題是為了提醒大家，儘管 AI 可以幫助校稿，但使用者仍需親自進行最後確認以確保資訊的準確性。</li>
</ol>



<h2 class="wp-block-heading">Google 和 Generative AI</h2>



<p>在 Internet 誕生之後，Google 可以說是其中最重要的里程碑之一。特別提到 Google 的原因是因為它和 ChatGPT 有某種相似之處。然而，兩者最大的區別在於：</p>



<ol class="wp-block-list">
<li>Google 是從簡單到複雜的過程：在 Internet 的早期，網站之間是用超連結（HyperLink，指的是點下去就可以連到另一個網站，現在很少人用這個詞）相互連接的。最初，入口網站以目錄方式提供服務，並提供搜尋功能。由於大家剛接觸網路，所以首頁都設置為入口網站。然而，隨著網絡規模的擴大，使用者變得難以獨自找到網絡上的資料。這時候，搜尋引擎便派上了用場。Google 的 PageRank 技術提高了有用網站的排名，增加了資料的可用性。從那時起，Google 逐漸取代了入口網站，成為了 Internet 世界的霸主。</li>



<li>Generative AI 是從複雜到簡單：現在，由於 SEO（Search Engine Optimization 搜尋引擎最佳化）的影響，我們在 Google 搜尋結果中常常找不到想要的資料，或者需要翻閱很多頁才能找到。而如今，我們只需向 ChatGPT 提問，它大部分時間給出的答案都是正確的，甚至有時還能提供超出我們意料之外的答案。這樣一來，與 Google 打交道的時間大大縮短了。</li>
</ol>



<p>然而，Google 和 Generative AI 都存在相同的問題。眾所周知，從 Google 獲得的資料常常有問題，即使是來自 Stack Overflow 的資料，也不一定能解決你的問題。另一個常見的例子是醫學資訊，對於這部分，使用 Google 搜尋可能會找到很多不同資料，這些資料提供的處理方法各異。因此，在這方面，我們通常只能了解個大概，並依賴醫生解決問題。</p>



<p>同樣的情況也會出現在 Generative AI 上，我們讓 Generative AI 為我們完成某些任務，然後再驗收成果。然而，目前我們可以預見到，對於複雜的命令，我們可能也難以驗證其正確性，這可能成為一個潛在問題。或許解決方案是像 Bing AI 那樣提供參考資料的網站，讓人類進行驗證。總之，仍然需要進行查核的工作。</p>



<p>不論是 Google 或 Generative AI，都無法完全保證提供的資訊的正確性。在使用這些工具時，我們需要保持警惕，並在必要時進行人工核對。隨著 AI 技術的不斷發展，未來或許能找到更好的解決方案來提高資訊的可靠性和準確性。然而，直到那時，我們仍需要依賴人類的智慧和判斷力來確保資訊的準確無誤。（註：本段是 GPT-4 憑空加入的，特別留下）</p>



<h3 class="wp-block-heading">生成式資料對抗 Google 和 Generative AI</h3>



<p>Google 近年面臨的一個困境可能是過多的 SEO 網站導致其搜尋結果的可信度降低。這些網站使用消費者常用的搜尋關鍵字，並根據這些關鍵字生成相關或無關的內容。</p>



<p>有些網站劣質地抄襲其他網站的內容，但經過 SEO 優化後，它們的排名卻高於原始網站，導致劣幣驅逐良幣的現象。有些甚至只有關鍵導引流量進去，內容都是無關的資料或是沒有內容。</p>



<p>如今 Generative AI 的出現使得更多看似內容合理的網站充斥網絡。由於這些網站的生成速度快、資料量大，Internet 上的充滿著生成式資料的網站，而這些網站經常在 Google 搜尋排名中名列前茅，使得 Google 搜尋的有效性進一步下降。在這種情況下，人們可能更願意直接向 ChatGPT 詢問問題，而不是翻閱 Google 搜尋結果的多個頁面。</p>



<p>下一代 Google 和 ChatGPT 都可能會使用相似的技術來識別高度 SEO 化和高度資料生成化的網站。然而，SEO 技術也可能會相應地升級以對抗這些新方法。未來發展難以預料，但個人認為搜尋可能會逐漸向 Generative AI 方向發展。畢竟，在過濾資訊方面，Generative AI 至少可以直接提供一個答案，而不是像 Google 一樣給出許多網站讓使用者過濾，這樣可以減少對大腦的負擔，如果 Generative AI 找不到再回去找 Google，這個態勢應該很快就會發生，或許這會是 Google 的惡夢，看看接下來 Google 能不能有效反擊了。</p>



<h2 class="wp-block-heading">工作流程半自動化的時代</h2>



<p>社會進步的基石是將計算能力轉換為生產力。早期的 Word/Excel 時代已經證明了這一點，通過滑鼠操作，可以輕鬆地生成統計數字和圖表。許多小型企業便可以利用 Excel 計算成本和營收。電子郵件減少了公文往來的時間和打電話的成本，釋放出來的時間可以用來提高生產力。隨著網絡購物的興起、Google 等搜尋引擎的發展以及 Food Panda/Uber Eats 等服務的出現，人們節省了大量時間。</p>



<p>Generative AI 正是利用計算能力換取生產力的典範，而且效果顯著。想象一下，一個專業的助手每月花費不到一千元台幣，這是多麼划算。Generative AI 至少可以做到以下幾點（但不限於）：</p>



<ol class="wp-block-list">
<li>繪圖，程式設計，即使不能完全符合需求，也能接近要求，大幅減少製作開發時程</li>



<li>翻譯</li>



<li>查找資料</li>



<li>進行基本研究，堆砌想法</li>



<li>協助除錯，如取代黃色小鴨除錯法</li>



<li>校對稿件</li>
</ol>



<p>這種將計算能力轉換為生產力的方式是顯而易見的。人們導入 Generative AI已經不是考慮需不需要，而是如何導入，或是在更成熟的時候導入的問題。</p>



<p>Generative AI 最終將實現工作流程的半自動化。至於為什麼不是全自動化，稍後會解釋。因為 Generative AI 並不能產生完全正確的資料，人類仍然需要在中間或最後進行把關。這也引出了一個值得思考的問題：如果 Generative AI 能夠實現全自動化，人類的角色將會是什麼？</p>



<h2 class="wp-block-heading">Model as a service(MAAS,模型即服務) 的未來展望</h2>



<p>（註：這段我覺得原來太短，讓 GPT-4 擴充一下，感覺好像論文呀）</p>



<p>MAAS可以說是平台即服務（Platform as a service, PAAS）和軟體即服務（Software as a service, SAAS）的延伸，它將模型視為平台或軟體。這種模式對於大型語言模型商用具有很大的潛力，因為這些模型需要強大的計算能力來運作。</p>



<p>目前即使是小型大語言模型也需要約 24GB 的顯示卡記憶體，這相當於兩張消費級顯示卡。而像 OpenAI 這樣的大型語料庫，所需的建模運算能力更是驚人，可能需要上萬張A100運算（註：A100需要45萬台幣，每 4~6 張還需要一台20~40萬伺服器）。除了運算能力的需求，這些大型模型還需要大量的資料清洗、整理和人力糾正語料庫資料。這樣的需求遠遠超出了一般小型企業或個人的負擔範疇。</p>



<p>隨著技術的發展，我們可以預期 MAAS 將成為未來的趨勢。通過將模型視為一種服務，企業和個人可以將其資源集中在其他方面，同時享受強大的生成式 AI 模型帶來的好處。</p>



<p>未來，MAAS 可能會涵蓋各種領域，包括但不限於自然語言處理、圖像生成、語音識別等。此外，隨著各種模型的發展，我們可能會看到更多針對特定領域的專業模型，這將大大提高這些模型在特定行業中的應用價值。</p>



<p>總之，隨著生成式 AI 技術的發展，MAAS 有望成為一個強大且實用的解決方案，讓企業和個人能夠充分利用這些先進的技術，以提高生產力和創新能力。</p>



<h2 class="wp-block-heading">優質內容的重要性與挑戰</h2>



<p>（註：本段上半部是我寫的，下半部是 GPT-4 延伸的）</p>



<p>隨著生成式 AI 的興起，我們不再缺乏內容，但優質內容卻越來越難以尋找。生成式 AI 的出現使得內容呈指數型增長，然而這卻同時帶來了難以區分原創和 AI 生成內容的問題。雖然許多文章看似精彩，但讀者可能會感覺到一種相似的套路，甚至具有一定的 AI 味道。像有個微信的帳號叫碧樹西風，他的文章每篇看起來就是都有模有樣，但是看久了就有一種 AI 味跑出來，我猜可能就是將概念抽取出來之後，找助手疏理過後再丟去 AI 產生的的文字，亦或是沒有丟 AI ，但是 AI 本身就是可以替代助手的工作，所以也就變成那個味道了。</p>



<p>儘管如此，生成式 AI 在天氣、金融報導等領域已經取得了不錯的成果，未來新聞產生也可能採用類似的技術。然而，生成式 AI 仍然無法滿足人類對優質內容的需求，因為其生成能力依賴於資料庫的品質。要獲得真正的優質內容，人類仍需要付出努力和資源。</p>



<p>依目前的使用者習慣，目前大部分人並不需要高品質的內容，這可以從短影片平台如抖音的流行中看出。儘管如此，優質內容仍然具有重要價值，書籍是其最佳來源之一。寫書仍然是一個具有吸引力的商業模式，讀者可以通過購買書籍獲得經過整理的系統性知識。例如，花費 500 元購買一本書，可以獲得作者精心整理的知識，相當划算。此外，不想買書讀者還可以選擇前往圖書館借閱書籍。</p>



<p>儘管書籍在當今時代仍然是優質內容的重要來源，但許多人可能會誤以為只需依賴 AI，就不再需要書籍。然而，這種觀念在 Google 時代已經被證明是錯誤的。我們需要意識到，優質內容對於學習和發展仍然具有不可替代的價值，不能僅僅依賴生成式 AI。在追求創新和知識成長的過程中，我們應該珍惜並尋求優質內容，而不僅僅是滿足於表面的內容需求。</p>



<p>因此，在這個充斥著生成式 AI 內容的時代，我們需要更加重視優質內容的挖掘和創作。教育機構、出版社和內容創作者應該強調原創性、深度和獨特性，以提供有益的知識和見解。同時，我們也需要為消費者提供更好的工具和管道，幫助他們在茫茫內容海洋中找到真正有價值的資訊。</p>



<p>在此背景下，AI 技術本身也有潛力成為優質內容挖掘的助力。例如，可以開發新型搜尋引擎和內容推薦系統，利用 AI 智能分析和評估內容質量，為用戶提供更精準和個性化的推薦。此外，AI 也可協助創作者改進他們的作品，提供創意靈感和審稿建議，從而提高內容的質量和多樣性。</p>



<p>總之，隨著生成式 AI 的普及，我們面臨著內容品質的挑戰。為了確保人類繼續獲得有益的知識和見解，我們需要重視優質內容的創作和傳播。這需要教育機構、出版商和創作者共同努力，並利用 AI 技術作為輔助工具，共同為用戶提供更豐富、有深度的內容體驗。</p>



<h2 class="wp-block-heading">詐騙集團利用 AI 的潛在風險</h2>



<p>當今，詐騙集團正利用先進科技迅速創新，以達到更高的詐騙效果。生成式 AI 作為一個強大的工具，很可能被這些犯罪分子利用，甚至形成一個全新的詐騙風險。例如，利用偽造的網站、合成語音或甚至是 AI 生成的聊天機器人來詐騙無辜的受害者。</p>



<p>在未來幾年內，我們可能會看到更多利用生成式 AI 技術的詐騙案例。這些案例可能包括結合生成的影片、語音和大型語言模型來欺騙人類。對於那些尚未意識到生成式 AI 威力的人們，這無疑是一個巨大的威脅。下面這個影片就是利用大語言模型開設一個假的網路商店的過程，而這個過程在有心人的包裝之下非常快的就可以建成一個基本的詐騙產業鍊。（當然正當用途也會更多在此就不討論了）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1204" height="896" src="https://blog.richliu.com/wp-content/uploads/2023/04/Fake_AI_Taobao.png" alt="" class="wp-image-5188" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/Fake_AI_Taobao.png 1204w, https://blog.richliu.com/wp-content/uploads/2023/04/Fake_AI_Taobao-600x447.png 600w, https://blog.richliu.com/wp-content/uploads/2023/04/Fake_AI_Taobao-768x572.png 768w" sizes="(max-width: 1204px) 100vw, 1204px" /><figcaption class="wp-element-caption"><a href="https://www.bilibili.com/video/BV15v4y1E7zV/" target="_blank" rel="noreferrer noopener">【36氪】我用AI开了家“假”淘宝店，居然真的有人下单？</a></figcaption></figure></div>


<p>然而，值得注意的是，許多公司和研究機構（如 OpenAI）正在努力對 AI 生成的內容進行審查，以防止其被惡意利用。這表明，在短期內，我們可能不會立即面臨成熟的 AI 詐騙模型。但這並不意味著我們可以放鬆警惕。</p>



<p>為了應對這些潛在的風險，政府、企業和個人都需要提高對生成式 AI 應用的認知。同時，AI 研究者和開發者應該關注生成式 AI 的潛在風險，並努力尋求減少不良影響的方法。這可能包括改進生成模型的安全性，以防止被惡意操控，以及開發能夠識別和過濾惡意 AI 生成內容的技術。</p>



<h2 class="wp-block-heading">李家同：競爭的問題</h2>



<p>（註：本段不知道為什麼 GPT-4 都無法校稿，都亂改，只能自己來了）</p>



<p>最近在臉書上看到很多人嘲笑李家同，主要是針對他的觀點『我們要創造不會思考的下一代？』在網路上引起了不少的爭議。雖然我不太同意他的觀點，但是在這裡，我想稍微談談這個問題。</p>



<p>例如我現在要用 ChatGPT 寫個 Python 作業，只要給了prompt，可能大部份的演算法作業都可以靠 ChatGPT 完成（註：讓 ChatGPT 找到演算法，並非是 ChatGPT 自己寫）。但是實際上，我們這一代在學校學習的時候，這部份都是自己手刻完成的。儘管手刻會比較慢，但這能讓我們對演算法有更深刻的認識，如果學校在這部份使用 ChatGPT 教學，就少了這部份打底的工作。</p>



<p>然而，現今很多新技術都是建立在前人的肩膀上，有時我們不需要再去學習太多東西，而是站在這些演算法之上建立新東西。以 C 語言為例，最早我學習電腦的時候，學程式都要學習 C 語言，如果要能夠精確的最佳化程式碼，那還要學習 Assembly code ，而且當年學習 Assembly code 還不夠，指令最佳化還要算到 instructions 的 timing。但是現在的情況已經不同了，現今的程式語言越來越高階，以 Python 為例，相較於 C 語言，Python 可以用更少的程式碼完成同樣的事情，而且 C 語言所需的指令最佳化等等複雜問題也不再是現今所需要考慮的問題，Compiler 都會協助完成所有的事情。在寫出程式這件事情上，python 的速度的是 C 的很多倍，而 python 本身效率的問題可以用暫時加機器達成這個目的。</p>



<p>但是在 python 的程式設計師能順利寫作的前提下，還是需要優秀的底層的工程師去發想並且進行各種最佳化 python 背後需要的技術，而擴展雲端設備之後的架構演算法也是需要紮實的基礎訓練，像是電腦系統架構，Assembly ，compiler ，network 等等知識，而這些東西剛剛好就是靠 ChatGPT 所無法完成的，需要自己一步一腳印的將基礎打好。甚至有些程式碼都是要非常熟悉這些演算法和電腦架構的人才改得動，ChatGPT 是幫不了任何忙的，這時候李家同講的是不是對的？（註：LLM 告訴你的都是他已知的，如果要走向未知還是要自己想，不過 LLM 最大的好處是可以幫忙發想新點子）</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="916" height="1086" src="https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_Assembly.png" alt="" class="wp-image-5189" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_Assembly.png 916w, https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_Assembly-506x600.png 506w, https://blog.richliu.com/wp-content/uploads/2023/04/ChatGPT_Assembly-768x911.png 768w" sizes="(max-width: 916px) 100vw, 916px" /><figcaption class="wp-element-caption">ChatGPT 不知道組語寫什麼</figcaption></figure></div>


<p>但是時代的火車是不留情的，所以李家同講的這些雖然是對的但是沒有用，Generative AI 終將會輾壓過去，能做李家同講的那些事情的人就變得鳳毛麟角，不過我想社會會自己調整，可能還是有人對這件事有興趣只是比較少而已，輪子還是有人造只是種類變少。當然也有一種可能就是大家不重視基礎只重視符號政治，政治凌駕專業，然後大家就將自己搞得愈來愈慘，這也是有可能的，畢竟改變不見得都是變好的。我想合理的狀況就是雖然互有消長，但是 LLM 最終還是幫助人類社會進步較多，畢竟我們已經踏在這些事情上面前進非常多步了。</p>



<p>最後來談談那些被科技所輾壓的人。如今的學生從小學就能接觸到網路，因此很多資訊都可以從網路上獲得。理想情況下，網路能夠彌平城鄉差距，事實上也有一些成功案例，例如沈芯菱。然而，媒體往往忽略了更多的負面效應。例如，網路讓性犯罪者能夠接觸到更多原本無法接觸的國中小學生，或者像近來一種名為繭居族的族群。我們熟悉日本文化的人知道，在日本這種情況很常見，但在現今的台灣國中小學生中也越來越普遍。這些孩子通常需要更多家庭資源，但因為缺乏家庭資源，最終卻將自己封閉在網路世界中，變成拒學症的受害者。當然我們不說網路害了他，但是網路讓他們有在家不出門的理由，科技帶來的便利和社會資源讓這些孩子從小封閉自己，失去了謀生和取得基本學歷的機會。這將成為未來的另一個社會問題。當我們的時代火車疾馳向前，是否有人能回頭關注那些被拋下的人呢？</p>



<p>然而，在這個時代的火車輾過後，真的有人會花時間去關心這些被科技輾壓過去的人嗎？其實只有像李老先生這樣的人才會真正關心他們。作為網路發展初期就接觸這些事情滿懷希望，到網路已經影響人類生活看到某些陰暗面的我們這一代人，應該在某種程度上也能理解李老先生此刻可能的想法吧。</p>



<h2 class="wp-block-heading">沒有結論的結尾</h2>



<p>這篇文章主要是闡述一些感想，畢竟它只是記錄了某個時間點的觀察。以下是一位對岸網友使用 GPT-4 分析會被影響工作的總結：大部分容易被取代的工作都是具有固定模式的。通過總結，我們大概可以了解大型語言模型將對哪些行業產生威脅。例如，程式設計師的被替代概率很高，但這是否意味著程式設計的應用門檻也降低了？這樣一來，各行各業的滲透率也將提高，因為能寫程式的人比例是固定的，他們可以去從事其他事情。而難以取代的工作幾乎都是需要實際操作的，這意味著未來將更多地屬於藍領工作者。</p>



<p>然而，許多被取代的工作，並非因為使用 AI，我們就可以完全信任 AI 的結果。因為最終仍需人類過濾，AI 只是能降低單一工作的工作量和成本。至於整體工作量，未必會減少。例如，許多翻譯工作都是兼職的，如果成本降低了，那麼他們可能需要尋找更多的兼職工作來彌補收入，但是這樣的影響之下，能提供翻譯的可能變多可能變少，變多就是門檻低大家只需要校稿，變少就是無利可圖，大家去做別的。總之，AI 在某些方面的確帶來了便利，但對於整體工作量和人類在各行業的作用，仍有待觀察。</p>



<p>或許正如黃仁勳所言，現在是 AI 的 iPhone 時代。大家都知道 iPhone 開創了智慧型手機的先河，Generative AI 同樣具有類似的地位。不過目前仍在 Generative 蠻荒年代，或許二十年後回來再在很多事情都會不一樣（希望不會是天網統治世界）。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1774" height="2048" src="https://blog.richliu.com/wp-content/uploads/2023/04/AI_AFFECT_JOB.png" alt="" class="wp-image-5190" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/AI_AFFECT_JOB.png 1774w, https://blog.richliu.com/wp-content/uploads/2023/04/AI_AFFECT_JOB-520x600.png 520w, https://blog.richliu.com/wp-content/uploads/2023/04/AI_AFFECT_JOB-768x887.png 768w, https://blog.richliu.com/wp-content/uploads/2023/04/AI_AFFECT_JOB-1331x1536.png 1331w" sizes="(max-width: 1774px) 100vw, 1774px" /></figure>



<p>最後丟一篇給 GPT-4 評價的結果</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="980" height="663" src="https://blog.richliu.com/wp-content/uploads/2023/04/image.png" alt="" class="wp-image-5195" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/image.png 980w, https://blog.richliu.com/wp-content/uploads/2023/04/image-600x406.png 600w, https://blog.richliu.com/wp-content/uploads/2023/04/image-768x520.png 768w" sizes="(max-width: 980px) 100vw, 980px" /><figcaption class="wp-element-caption">GPT-3.5</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1058" height="941" src="https://blog.richliu.com/wp-content/uploads/2023/04/image-1.png" alt="" class="wp-image-5200" srcset="https://blog.richliu.com/wp-content/uploads/2023/04/image-1.png 1058w, https://blog.richliu.com/wp-content/uploads/2023/04/image-1-600x534.png 600w, https://blog.richliu.com/wp-content/uploads/2023/04/image-1-768x683.png 768w" sizes="(max-width: 1058px) 100vw, 1058px" /><figcaption class="wp-element-caption">GPT-4</figcaption></figure></div><p>The post <a rel="nofollow" href="https://blog.richliu.com/2023/04/22/5185/generative-ai-chatgpt/">Generative AI(生成式AI)/ChatGPT</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2023/04/22/5185/generative-ai-chatgpt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
