<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raymond Chang on Medium]]></title>
        <description><![CDATA[Stories by Raymond Chang on Medium]]></description>
        <link>https://medium.com/@raymondchang_24290?source=rss-4f70af105064------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3ecMlfyS68t_j6HVObH1LA.png</url>
            <title>Stories by Raymond Chang on Medium</title>
            <link>https://medium.com/@raymondchang_24290?source=rss-4f70af105064------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:11:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raymondchang_24290/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[開源軟體與商業模式的選擇]]></title>
            <link>https://medium.com/@raymondchang_24290/%E9%96%8B%E6%BA%90%E8%BB%9F%E9%AB%94%E8%88%87%E5%95%86%E6%A5%AD%E6%A8%A1%E5%BC%8F%E7%9A%84%E9%81%B8%E6%93%87-eae615a3d583?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/eae615a3d583</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[gpl]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 15:54:02 GMT</pubDate>
            <atom:updated>2024-04-20T15:54:02.002Z</atom:updated>
            <content:encoded><![CDATA[<p>最近在幫忙開發一個零代碼的RAG自動化平台, 被問到了使用開源軟體的問題, 我剛好也在Linux社群幫忙維持一個開源軟體，最近Redis變更授權方案也曾經引起很多開發朋友的關注，就跟大家簡單介紹下各種開源方案與商業模式的關係。不過我先聲明，如果你在台灣或大陸目標是2B，不是很建議採用開源社區的方式來增加使用者基礎，通常是面對全球市場，也考慮把2D列入, 而且對現金流的產生方式有把握才需要深入了解。</p><p>當然你也可以來詢問我實施經驗。</p><p>截至2023年,96%的軟體都包含某種開源元件,開源軟體佔現代軟體解決方案的70%到90%。然而,在享受開源帶來的便利的同時,我們也必須思考如何讓開源項目獲得可持續發展。我將跟大家分享不同的開源授權方案、其背後的資金來源,以及相應的商業模式。如果是條款細節建議您諮詢有經驗的律師。</p><p>一、開源授權方案比較</p><p>1. Copyleft型授權(如GPL)</p><p>- 特點:要求衍生作品也必須以相同的授權分發,確保修改版本仍然開放可得。</p><p>- 代表專案:Linux內核、GCC編譯器、WordPress等。</p><p>- 優點:保護了開源精神,防止專有化;有利於社群貢獻和協作。</p><p>- 缺點:對商業應用有較多限制;可能影響專案的吸引力和普及度。</p><p>2. 寬鬆型授權(如MIT、Apache)</p><p>- 特點:允許將軟體用於各種用途,包括商業應用;要求保留版權聲明和免責條款。</p><p>- 代表專案:Angular、TensorFlow、Kubernetes等。</p><p>- 優點:靈活性高,有利於專案的採用和推廣;對商業友好。</p><p>- 缺點:修改版本可能不會回饋社群;品牌recognition相對較弱。</p><p>3. 商業原始碼授權(如BSL)</p><p>- 特點:禁止將程式碼用於特定的生產環境,但允許用於非生產目的;原始碼公開。</p><p>- 代表專案:MariaDB、CockroachDB等。</p><p>- 優點:在開放與商業之間取得平衡;為商業化提供了更多空間。</p><p>- 缺點:對社群貢獻的吸引力可能稍遜;許可證更新可能影響使用者。</p><p>4. 雙授權模式</p><p>- 特點:同時提供開源版(通常是Copyleft型)和商業版,滿足不同使用者的需求。</p><p>- 代表專案:MySQL、MongoDB等。</p><p>- 優點:靈活性高,可根據實際需要選擇適合的版本;有利於專案的推廣和商業化。</p><p>- 缺點:兩個版本的維護和同步可能有額外開銷;商業版定價可能面臨挑戰。</p><p>二、開源項目的資金來源</p><p>1. 基金會和非營利組織</p><p>- 知名基金會:Linux基金會、Apache軟體基金會、OpenJS基金會等。</p><p>- 籌資方式:會員費、贊助、捐款等。</p><p>- 資金用途:支持專案開發、社群建設、基礎設施維護等。</p><p>2. 企業贊助</p><p>- 常見形式:直接資助、提供開發資源、舉辦活動等。</p><p>- 動機:培養開發者生態、提升品牌形象、獲取人才等。</p><p>- 代表企業:Google、Microsoft、IBM、Intel等科技巨頭。</p><p>3. 雲端服務商</p><p>- 商業模式:提供托管服務,或在雲平台上整合開源軟體,收取服務費。</p><p>- 代表企業:Amazon Web Services、Google Cloud、Microsoft Azure等。</p><p>- 爭議:有時會將開源專案商業化而引發社群不滿,如AWS與Elasticsearch的案例。</p><p>4. 群募(crowdfunding)和捐款</p><p>- 平台:Patreon、Open Collective、GitHub Sponsors等。</p><p>- 適用專案:較小型、社群驅動的專案;或核心開發者需要獲得報酬的情況。</p><p>- 挑戰:籌資規模相對有限;可持續性有待觀察。</p><p>5. 開源軟體即服務(Open SaaS)</p><p>- 模式:在開源軟體的基礎上,提供托管服務並收取訂閱費。</p><p>- 代表公司:<a href="https://l.facebook.com/l.php?u=https%3A%2F%2FWordPress.com%2F%3Ffbclid%3DIwZXh0bgNhZW0CMTAAAR2krWiIlCi6UM62NSl0TgTOdeE2VJnbhw-7ed74i2t6tnVMOn7Odbi17ZM_aem_AR6ojRWDQc-m-ND-KTsskSt0uIet_TWpyBtjBUNhBZExhYRngGAk5qyhvUoGUOinnZqEfhRKN3yrax9VedgpGHL4&amp;h=AT36zljKRCA5g-asX8vmydB_oRLLKAUx_64prGjGpvGw9kplUToBoiVfLjor0mnDUjqNnnbS8mSriyw-tTYmEer1iKA0p9rzcG6pZjbl4ItEh3Y2ZTmetRuzhuQLbVO9tPQT&amp;__tn__=-UK-R&amp;c[0]=AT3dQpjYNZgCe9yAPkIzPn3Ea1YGlkrDGMJ1CitNS9gkltnM1TmYjoIQ_BhaQotuyz_krlm8uxnIvIB2T9NVX3scabEg6AofLKVO2AVzKm4-HJ6dFviSgmhu4kF2dLWYaQftzV6-i8dUEz5gtsUeyE8oweqqky-n6ViRU1ES45mRan0SgQ7Pd-TQAG9KRoLireUo2vbJnFRdpQhE81KtUneh3-BLthDBUx8">WordPress.com</a>、GitLab等。</p><p>- 優勢:使用者無需自行部署和維護;為開源專案帶來持續收入。</p><p>三、商業模式比較</p><p>1. 開源軟體+企業服務</p><p>- 模式:核心產品開源,通過提供諮詢、培訓、定制開發等服務獲利。</p><p>- 代表公司:Red Hat、Canonical等。</p><p>- 優勢:服務具有專業性和針對性;與客戶建立長期關係。</p><p>- 挑戰:服務業務的可擴展性相對受限;需要大量優秀的技術人才。</p><p>2. 開源軟體+商業許可</p><p>- 模式:提供額外的商業特性或企業級支持,通過售賣商業許可證盈利。</p><p>- 代表公司:Confluent、Cockroach Labs等。</p><p>- 優勢:產品本身即可帶來收入;相比服務,具有更好的可擴展性。</p><p>- 挑戰:需要持續開發有價值的商業特性;面臨社群反應和潛在的分叉風險。</p><p>3. 開放核心(Open Core)</p><p>- 模式:核心功能開源,高級特性或企業版採用商業授權。</p><p>- 代表公司:Elastic、Redis Labs等。</p><p>- 優勢:開源版吸引使用者和貢獻者,商業版提供差異化的價值。</p><p>- 挑戰:需要在開源和商業之間取得平衡;面臨競爭對手利用開源版的風險。</p><p>4. 雲端托管和服務</p><p>- 模式:在雲端提供開源軟體的託管實例,或圍繞開源專案提供管理服務。</p><p>- 代表公司:AWS、Google Cloud、Microsoft Azure等。</p><p>- 優勢:使用者可以快速上手,無需關心底層基礎設施;雲端市場前景廣闊。</p><p>- 挑戰:競爭激烈,需要持續投入基礎設施和運維;可能面臨社群的licensewashing質疑。</p><p>5. 基於開源的SaaS</p><p>- 模式:在開源軟體之上構建SaaS產品,提供增值功能和服務。</p><p>- 代表公司:Automattic、Mattermost等。</p><p>- 優勢:顯著降低使用門檻;可以快速迭代和交付新功能;具有穩定的訂閱收入。</p><p>- 挑戰:需要投入大量資源構建和運營SaaS平台;競爭激烈,需要持續創新。</p><p>四、開源授權方案詳解</p><p>1. GNU通用公共許可證(GPL)</p><p>- 授權特點:Copyleft型,要求衍生作品也必須以相同的授權分發,確保修改版本仍然開放。</p><p>- 適用場景:適合希望保護開源理念、防止專有化的專案,如作業系統、編譯器等基礎設施。</p><p>- 申請方式:在專案中包含GPL許可證文本,並在每個原始碼檔案中添加版權聲明和許可證標示。</p><p>- 授權方:由自由軟體基金會(FSF)管理,無需向特定組織申請,但需要遵守GPL的條款。</p><p>- 採用實例:Linux內核、GCC編譯器、WordPress等知名開源專案廣泛採用GPL。</p><p>2. 阿帕奇許可證(Apache License)</p><p>- 授權特點:寬鬆型,允許自由使用、修改、分發,要求保留版權聲明和免責條款。</p><p>- 適用場景:適合鼓勵廣泛採用、與專有軟體結合的專案,如函式庫、框架等。</p><p>- 申請方式:在專案中包含Apache許可證文本,並在每個原始碼檔案中添加版權聲明和許可證標示。</p><p>- 授權方:由阿帕奇軟體基金會(ASF)管理,無需向特定組織申請,但需要遵守Apache許可證的條款。</p><p>- 採用實例:Apache HTTP伺服器、Hadoop、Spark等知名Apache專案,以及Angular、TensorFlow等廣泛使用的開源軟體。</p><p>3. 麻省理工學院許可證(MIT License)</p><p>- 授權特點:寬鬆型,允許自由使用、修改、分發,要求保留版權聲明和許可證文本。</p><p>- 適用場景:適合希望最大限度減少使用限制、鼓勵廣泛採用的專案,如工具、函式庫等。</p><p>- 申請方式:在專案中包含MIT許可證文本,並在每個原始碼檔案中添加版權聲明和許可證標示。</p><p>- 授權方:由麻省理工學院(MIT)提出,無需向特定組織申請,但需要遵守MIT許可證的條款。</p><p>- 採用實例:jQuery、Node.js、Rails等知名開源專案,以及眾多的開源函式庫和工具。</p><p>4. 商業原始碼許可證(BSL)</p><p>- 授權特點:平衡開放與商業,允許免費使用,但禁止在生產環境中部署修改後的版本。</p><p>- 適用場景:適合希望開放原始碼但保留商業授權彈性的專案,如資料庫、中間件等。</p><p>- 申請方式:在專案中包含BSL許可證文本,並在每個原始碼檔案中添加版權聲明和許可證標示。</p><p>- 授權方:由專案所有者自行管理,無需向特定組織申請,但需要遵守BSL的條款。</p><p>- 採用實例:MariaDB、CockroachDB、Sentry等開源專案採用BSL或類似的商業原始碼許可證。</p><p>五、使用開源方案的公司現況</p><p>1. 紅帽(Red Hat)</p><p>- 商業模式:提供基於開源軟體的企業級訂閱服務,包括支援、維護、培訓等。</p><p>- 代表產品:Red Hat Enterprise Linux、OpenShift、Ansible等。</p><p>- 發展現況:2019年被IBM以340億美元收購,繼續深耕開源生態系統,推動混合雲和自動化。</p><p>2. Confluent</p><p>- 商業模式:圍繞Apache Kafka項目提供商業訂閱和雲端服務。</p><p>- 代表產品:Confluent Platform、Confluent Cloud等。</p><p>- 發展現況:2021年IPO,市值超過150億美元,持續擴大在即時數據流處理領域的影響力。</p><p>3. Elastic</p><p>- 商業模式:提供Elasticsearch、Kibana等開源專案的商業訂閱和雲端服務。</p><p>- 代表產品:Elastic Stack、Elastic Cloud等。</p><p>- 發展現況:2018年IPO,市值超過100億美元,持續創新,拓展安全、可觀測性等新領域。</p><p>4. MongoDB</p><p>- 商業模式:提供基於開源文件型資料庫的商業訂閱和雲端服務。</p><p>- 代表產品:MongoDB Enterprise Advanced、MongoDB Atlas等。</p><p>- 發展現況:2017年IPO,市值超過300億美元,持續引領NoSQL資料庫的創新和應用。</p><p>5. Automattic</p><p>- 商業模式:在WordPress開源專案基礎上,提供託管服務和商業功能擴充。</p><p>- 代表產品:<a href="https://l.facebook.com/l.php?u=https%3A%2F%2FWordPress.com%2F%3Ffbclid%3DIwZXh0bgNhZW0CMTAAAR0ehy-2tC4GaQNHpiJ68AUoQC-iwZveZpLRzVar2_KsryU1uiDCjfYMnvo_aem_AR7J9jTUzxYoxgBB3cokBy_7OmhxIE5uBi-zJUg849M-asUYgEtnCaOe3xcp_ShUuDk2YSTyJcGlKjfyqGMPP7ah&amp;h=AT36zljKRCA5g-asX8vmydB_oRLLKAUx_64prGjGpvGw9kplUToBoiVfLjor0mnDUjqNnnbS8mSriyw-tTYmEer1iKA0p9rzcG6pZjbl4ItEh3Y2ZTmetRuzhuQLbVO9tPQT&amp;__tn__=-UK-R&amp;c[0]=AT3dQpjYNZgCe9yAPkIzPn3Ea1YGlkrDGMJ1CitNS9gkltnM1TmYjoIQ_BhaQotuyz_krlm8uxnIvIB2T9NVX3scabEg6AofLKVO2AVzKm4-HJ6dFviSgmhu4kF2dLWYaQftzV6-i8dUEz5gtsUeyE8oweqqky-n6ViRU1ES45mRan0SgQ7Pd-TQAG9KRoLireUo2vbJnFRdpQhE81KtUneh3-BLthDBUx8">WordPress.com</a>、WooCommerce、Jetpack等。</p><p>- 發展現況:2019年估值達30億美元,用戶遍及全球,持續推動開源網路出版和電子商務。</p><p>六、如何選擇和應用開源方案</p><p>1. 評估專案目標和需求</p><p>- 確定專案的功能、性能、可靠性等關鍵需求。</p><p>- 考慮專案的目標受眾和潛在的商業化路徑。</p><p>- 評估專案對開放性、社群貢獻、品牌推廣等方面的訴求。</p><p>2. 選擇匹配的開源許可證</p><p>- 對比各種開源許可證的特點和義務,選擇與專案目標相契合的許可證。</p><p>- 考慮許可證對商業化的影響,權衡開放性和控制力。</p><p>- 評估許可證在目標社群和使用者中的接受度和熟悉度。</p><p>3. 制定貢獻和治理策略</p><p>- 建立清晰的貢獻指南和流程,鼓勵社群參與。</p><p>- 設計合理的治理模型,平衡社群貢獻和專案掌控。</p><p>- 持續投入資源,培育和激勵健康、活躍的開源社群。</p><p>4. 建立商業模式和生態戰略</p><p>- 在開源的基礎上,發展差異化的商業產品和服務。</p><p>- 探索訂閱、支援、諮詢、定制開發等多元變現方式。</p><p>- 打造開放、協作的生態系統,實現與合作夥伴的共贏。</p><p>5. 遵循許可證義務和最佳實踐</p><p>- 嚴格遵守所選開源許可證的各項要求,如版權聲明、原始碼披露等。</p><p>- 建立許可證合規性審查和管理流程,降低法律風險。</p><p>- 積極回饋開源社群,貢獻程式碼、文檔、資金等資源。</p><p>開源軟體正在蓬勃發展,並衍生出多樣化的商業模式。紅帽、Confluent、Elastic等公司的成功實踐,展示了開源與商業的巧妙結合。對於開源專案而言,選擇合適的授權方案,制定匹配的商業戰略,並遵循許可證義務和社群最佳實踐,是實現可持續發展的關鍵。</p><p>查看洞察報告和廣告</p><p><a href="https://www.facebook.com/ad_center/create/boostpost/?entry_point=www_profile_plus_newsfeed&amp;page_id=230456366825032&amp;target_id=303258192812031&amp;__cft__[0]=AZWq132niUSRTPmfLh6Zso4mqhYgJQD7cPuMu5wixFDvBU75pfpU5r57kxWU4rMbuwhInL1xuFuMfKTh59UQLX8r7vpI6BsTV-LbVutpIwW713b7ADVg7ZsQFqhO5UnD-Ijo1GXhrOiaBx68BQs6xdhp6ujzV8GyFmAXitp1_4XrYuHzi9o4QADmc7qfMgyeKvt4-fZGiDfR8A47zklr94Xo&amp;__tn__=*W-R">加強推廣貼文</a></p><p>所有心情：</p><p>21陳建同、Ling-Sen Wu和其他19人</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eae615a3d583" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[在訓練和推理中權衡計算資源的使用]]></title>
            <link>https://medium.com/@raymondchang_24290/%E5%9C%A8%E8%A8%93%E7%B7%B4%E5%92%8C%E6%8E%A8%E7%90%86%E4%B8%AD%E6%AC%8A%E8%A1%A1%E8%A8%88%E7%AE%97%E8%B3%87%E6%BA%90%E7%9A%84%E4%BD%BF%E7%94%A8-9e03b1455d13?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e03b1455d13</guid>
            <category><![CDATA[chinchilla]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 02:29:19 GMT</pubDate>
            <atom:updated>2024-04-19T02:34:37.639Z</atom:updated>
            <content:encoded><![CDATA[<p>關鍵要點:</p><ul><li>在當前的機器學習系統中,系統的性能與訓練過程中花費的計算資源密切相關。然而,也可以通過在推理階段增加計算資源來提升已訓練模型的能力,或者以降低性能為代價減少推理計算量。例如,可以對模型進行剪枝以減少推理成本,或指示模型通過思維鏈進行推理,從而增加推理成本。</li><li>根據五種具體技術(模型擴展、蒙特卡羅樹搜索、剪枝、重採樣和思維鏈)的證據,我們預計相對於大多數當前模型(如GPT-4),有可能:</li><li>將每次推理的計算量增加1–2個數量級(OOM),以換取節省約1個OOM的訓練計算量,同時保持性能。我們預計這適用於大多數不需要特定事實知識或非常具體技能的語言任務(例如:知道如何押韻)。</li><li>將每次推理的計算量增加2–3個OOM,以換取節省約2個OOM的訓練計算量,同時保持性能。我們預計這適用於具有順序推理成分或可分解為更簡單子任務的任務。</li><li>將每次推理的計算量增加5–6個OOM,以換取節省3–4個OOM的訓練計算量。我們預計這只會發生在解決方案可以廉價驗證且可以低成本並行多次嘗試的任務中。我們只在解決編程問題和證明形式數學陳述的情況下觀察到這一點。</li><li>另一方面,在保持性能的同時,也可以將每次推理的計算量減少至少約1個OOM,以換取增加1–2個OOM的訓練計算量。我們預計這適用於大多數任務。</li><li>這項工作的一個關鍵啟示是強調了模型能力和部署規模之間的權衡。由於推理是大規模部署模型的主要成本,AI公司將應用一些節省計算量的技術來最小化他們向公眾提供的模型的推理成本。</li><li>同時,這些公司可能能夠利用額外的推理計算資源,以較小的規模實現更好的能力,無論是供內部使用還是少量外部客戶使用。尋求控制危險AI能力發展或擴散的政策提案應該考慮到這種可能性。</li></ul><p>各項技術的比較:</p><p><a href="https://sheetsu.com/tables/9d8f5c0c13">https://sheetsu.com/tables/9d8f5c0c13</a></p><p>背景與概述:</p><ul><li>機器學習系統中訓練計算量與能力之間的關係是眾所周知的,並已通過縮放定律的視角進行了廣泛研究。這種關係導致了當前先進AI能力集中在擁有大量計算資源的公司中。它也被用於預測AI能力,並構成了一些旨在控制前沿AI能力發展和擴散的擬議政策的技術基礎。</li><li>推理計算對能力的影響受到的關注較少。雖然這種影響是有限的,但我們認為它足夠重要,值得考慮。有多種技術可以通過在推理期間花費更多的計算資源來換取改進的能力。這種可能性導致了在訓練或推理上投入更多資源之間的權衡取捨。</li><li>訓練和推理計算之間的關係很複雜:我們必須區分單次推理的成本(這是模型的技術特徵)和模型生命週期內所有推理的總成本(還取決於執行的推理次數)。</li><li>單次推理的成本遠低於訓練過程的成本。一個很好的經驗法則是,推理的成本接近於訓練成本的平方根,儘管變化很大。</li><li>與此同時,模型生命週期內推理的總成本通常遠遠超過訓練的成本,因為同一模型被用於執行大量推理。</li></ul><p>研究的技術:</p><ol><li>改變擴展策略</li><li>蒙特卡洛樹搜索</li><li>剪枝</li><li>重複採樣和過濾</li><li>思維鏈和模型級聯</li></ol><p>通過對這些技術的分析,我們發現:</p><ul><li>這些技術可以組合使用,以獲得更大的權衡。例如,在Hex遊戲中,我們同時擁有Chinchilla式權衡和MCTS權衡的數據,可以分別和組合地比較這兩者的範圍。組合權衡的跨度接近於兩個獨立跨度的總和。</li><li>並非所有這些技術都能有效結合。也就是說,結合其中一些技術不會產生更大的權衡。我們推測Chinchilla和剪枝技術不能有效結合,因為它們都使用模型大小作為獨立參數。類似地,MCTS和重採樣技術可能也不能很好地結合,因為它們都涉及對模型的重複查詢。</li><li>考慮到這一點,我們認為使用技術組合可以節省2–3個數量級的計算資源,因為結合兩個以上的技術通常是無效的。其中一些技術(特別是思維鏈和MCTS)似乎主要為具有組合結構的任務(如序列推理)產生效益。其他任務可能不會有如此大的節省。</li></ul><p>權衡模型:</p><ul><li>從我們對不同技術產生的權衡的研究中,我們確定了三種定性不同類型的權衡。它們之間的相關差異是:</li></ul><ol><li>在保持另一個因素不變的情況下,性能是否隨著訓練或推理計算量的增加而飽和</li><li>權衡的跨度是恆定還是隨著規模而減少。</li></ol><ul><li>當我們接近完美完成手頭任務時,我們可能會看到隨規模減少的跨度,如Hex和MATH中所見。同時,當我們可以在許多數量級內繼續擴展模型而不達到平台期時,我們傾向於看到恆定的跨度。</li></ul><p>總結:</p><ul><li>從我們對四種不同技術的研究中,我們確定了訓練/推理計算權衡的幾個定性和定量屬性。在大多數情況下,我們預計這種權衡在增加規模時會保持恆定或減少的跨度,並且我們預計這種跨度在兩個因素中都大約為一到兩個數量級。</li><li>採樣和無限試驗技術的情況可能是一個例外,在這種情況下,額外的推理計算總是能帶來顯著的回報,而且似乎可以實現更大的跨度(六個數量級或更多),並且隨著規模的增加而增加。然而,我們只是通過將縮放定律外推到擬合範圍的兩倍得出這一結論。此外,在更簡單的數學生成基準測試中,結果並未顯示出這種增加的跨度。因此,我們目前對無限試驗的重採樣技術是否如我們所指出的那樣有希望抱有較低的信心。</li><li>上述一些技術可以組合使用,以產生兩到三個數量級的權衡跨度。可能會發現其他技術可以與現有技術結合使用,但只要這些新技術產生與已知技術類似的權衡,我們就不希望看到跨越三到四個數量級以上的權衡。</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e03b1455d13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft and their new ZeroQuant]]></title>
            <link>https://medium.com/@raymondchang_24290/microsoft-and-their-new-zeroquant-14ddb121e04b?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/14ddb121e04b</guid>
            <category><![CDATA[dl]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[training]]></category>
            <category><![CDATA[aigc]]></category>
            <category><![CDATA[inference]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 05:33:07 GMT</pubDate>
            <atom:updated>2024-04-18T05:33:44.276Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6dPxkOl9CDFe_EqDC9dFg.png" /></figure><p>Microsoft and their new ZeroQuant(4+2) quantization strategy for large language models (LLMs)! This is a significant development in the field of model quantization and efficiency optimization. Let me provide a summary and analysis of the key points :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*wYiZDFQpGryDp2QDr_vHkQ.png" /></figure><p>1. Limitations of INT4 quantization:<br> — INT4 quantization, while reducing model size, can lead to significant performance degradation.<br> — Simply shifting to higher precision formats like FP6 has been challenging.</p><p>2. Robustness and superiority of FP6 quantization:<br> — The paper demonstrates that FP6, even with a coarse-grain quantization scheme, performs robustly across various algorithms and tasks.<br> — FP6 shows superiority in terms of accuracy and versatility compared to INT4.</p><p>3. Performance comparison:<br> — With FP6 quantization, the \\codestar-15B model achieves comparable performance to its FP16 counterpart in code generation tasks.<br> — For smaller models like the 406M, FP6 quantization closely matches the baseline performance in summarization tasks.<br> — These performance levels cannot be achieved by INT4 quantization.</p><p>4. Novel 4+2 design for FP6:<br> — The paper proposes a new 4+2 design for FP6 quantization to achieve similar latency to state-of-the-art INT4 fine-grain quantization.<br> — The 6-bit number is divided into two components:<br> — A 4-bit sub-number handling elements like the sign bit and a 3-bit exponent.<br> — A 2-bit sub-number dedicated to the 2-bit mantissa.<br> — This design addresses memory access challenges and balances memory footprint reduction with practical dequantization requirements.</p><p>5. Bias shift technique:<br> — A bias shift technique is introduced to simplify the dequantization process from FP6 to FP16 during runtime on GPUs.<br> — This technique significantly enhances system performance.</p><p>The ZeroQuant(4+2) quantization strategy proposed by Microsoft offers a promising solution to the limitations of current 4-bit quantization methods used in LLMs. By leveraging the robustness and accuracy of FP6 quantization, along with the novel 4+2 design and bias shift technique, this approach aims to achieve similar latency to INT4 quantization while maintaining superior performance.</p><p>This research has the potential to significantly impact the deployment and efficiency of LLMs in various applications. By reducing the memory footprint and computational requirements without compromising accuracy, the ZeroQuant(4+2) strategy could enable the deployment of large models on resource-constrained devices and accelerate inference times.</p><p>However, it’s important to note that further research and evaluation may be necessary to validate the generalizability and scalability of this approach across different model architectures and tasks. Additionally, the practical implementation and adoption of this quantization strategy by the wider research community and industry will be crucial to realizing its full potential.</p><p>Overall, Microsoft’s ZeroQuant(4+2) quantization strategy represents a significant step forward in the ongoing efforts to optimize LLMs for efficiency and performance, and it opens up new possibilities for deploying these models in real-world applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14ddb121e04b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How far can “Next Token Prediction” go?]]></title>
            <link>https://medium.com/@raymondchang_24290/how-far-can-next-token-prediction-go-b330d72c7754?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/b330d72c7754</guid>
            <category><![CDATA[token]]></category>
            <category><![CDATA[llm-agent]]></category>
            <category><![CDATA[aigc]]></category>
            <category><![CDATA[transformer-model]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 16:27:20 GMT</pubDate>
            <atom:updated>2024-04-15T16:27:20.331Z</atom:updated>
            <content:encoded><![CDATA[<p>In recent years, Large Language Models (LLMs) have made significant breakthroughs in the field of natural language processing. One of the core technologies supporting these LLMs is Next Token Prediction (NTP).</p><p>The NTP technique was first proposed by Claude Shannon, the “father of information theory,” in his work “A Mathematical Theory of Communication.” The core idea is to let the model predict the next most likely word by giving the context of a sequence of words. This predictive ability enables language models to generate coherent, logically strong text, playing an important role in scenarios such as machine translation, text summarization, and automatic writing.</p><p>In this groundbreaking paper, Shannon systematically defined the concept of “information” for the first time and gave a mathematical representation of information. He introduced the “bit” as the basic unit of information and proposed the famous “Shannon entropy” formula to calculate the average amount of information contained in a random variable. This formula has since been widely applied in various fields and has become one of the core concepts of modern information theory.</p><p>The definition of Shannon entropy is as follows:</p><p>For a discrete random variable X with probability distribution P(X=x_i) = p_i, i=1,2,…,n, the Shannon entropy of X is:</p><p>H(X) = -∑[i=1 to n] p_i log p_i</p><p>where the base of the logarithm is usually 2, so the unit of entropy is bits. If the natural constant e is used as the base, the unit of entropy is nats.</p><p>Some important properties of Shannon entropy:</p><p>Non-negativity: H(X) ≥ 0, that is, Shannon entropy is always non-negative.<br>When the distribution of X is uniform, Shannon entropy reaches its maximum value of log n. This means that a uniform distribution has the greatest uncertainty.<br>When the distribution of X is a deterministic distribution (i.e., the probability of an event is 1 and the probability of other events is 0), Shannon entropy reaches its minimum value of 0. This means that a deterministic distribution has no uncertainty.</p><p>Shannon entropy satisfies some important inequalities, such as the mean inequality and the subadditivity inequality, which are very useful in deriving information theory.</p><p>In information theory and coding theory, Shannon entropy is used to measure the average amount of information of an information source, or the average number of bits required to transmit a symbol.</p><p>In addition, Shannon also proposed two major theorems in the paper:</p><p>Shannon’s Source Coding Theorem: This gives the limit compression rate of source coding, i.e., source entropy. This means that when the coding length tends to infinity, the average length of each coding symbol will not be less than the Shannon entropy of the source.</p><p>Shannon’s Channel Coding Theorem: This proves that there exists a coding method such that when communicating through a noisy channel, the transmission error rate can be arbitrarily close to zero as long as the information transmission rate is lower than the channel capacity. The channel capacity formula is:<br>C = B log2(1 + S/N)</p><p>where C is the channel capacity (unit: bit/s), B is the channel bandwidth (unit: Hz), and S/N is the signal-to-noise ratio.</p><p>These two major theorems laid the foundation for modern coding theory, pointing out the theoretical limits of reliable communication and having a profound impact on the development of modern communication technology.</p><p>Although Shannon’s original paper did not directly mention the concept of “Next Token Prediction” (NTP), his information theory ideas undoubtedly provided a theoretical cornerstone for the development of NTP technology. The core idea of NTP can be seen as an extension and application of Shannon’s theory — by minimizing the uncertainty (i.e., Shannon entropy) of predicting the next token, language models are trained to generate coherent, high-quality text.</p><p>OpenAI’s chief scientist Ilya Sutskever believes even more firmly that NTP is the key to AGI (Artificial General Intelligence). He believes that the quality of token prediction reflects the model’s understanding of the semantics and knowledge hidden behind language, which is not just statistics, but a compression and expression of the essence of the world. If a sufficiently powerful language model is asked to predict the behavior and mannerisms of a wise, erudite, and exceptionally capable person, it is likely that it can reason and extrapolate from human data to simulate hypothetical scenarios that go beyond reality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35BW2hP7aTlZDTdaiylkqQ.jpeg" /></figure><p>In fact, OpenAI researcher Jack Rae gave a talk titled “Compression for AGI” at a Stanford seminar, detailing the view that “compression is intelligence.” He believes that the ability to compress reflects a model’s ability to generalize and abstract from data, and the ability to generalize is the cornerstone of intelligence.</p><p>The basic principles of NTP technology can be summarized as follows:</p><p>1. NTP is the core task of causal language models, with the goal of accurately predicting the next token (such as a word or character) in a given text sequence. The token prediction process is based on an autoregressive mechanism, where the model predicts one token at a time in a left-to-right order.</p><p>2. Most NTP models are based on the Transformer architecture, especially its Decoder-Only variant. Through the Self-Attention mechanism, the Transformer allows the model to consider the contextual information of all previous tokens when generating each new token, thus generating more accurate and coherent text.</p><p>3. Before performing next token prediction, the text first needs to be segmented into the smallest units that the model can understand, i.e., tokens. These tokens are then converted into embedding vectors and represented numerically. To allow the model to understand the order of the tokens, the embedding vector of each token is added to the positional embedding vector, allowing the model to capture the positional information in the sequence.</p><p>4. Large language models learn next token prediction by pre-training on large-scale text datasets. This process is self-supervised, meaning that the model trains itself by predicting the next token in the text sequence without requiring externally labeled training data. In this way, the model learns to understand and generate natural language.</p><p>Traditional robot control methods, such as the motion control algorithms used by Boston Dynamics, reinforcement learning, and behavioral cloning, usually require specialized modeling and planning of the environment and tasks. Although this approach performs well in specific environments, it has limited generalization ability and is difficult to adapt to the complex and changing real world.</p><p>The NTP (Next Token Prediction) technology based on autoregressive generation opens up a new path for robot control. By serializing sensorimotor data into tokens similar to natural language and training an autoregressive language model similar to GPT to predict the next token, robots can directly learn coherent and vivid behavior patterns from a large amount of historical interaction data without explicitly modeling the environment or path planning.</p><p>The advantage of this paradigm shift is that autoregressive generative models have strong generalization capabilities. By learning from massive and diverse sensorimotor data, models can grasp the implicit rules of the environment and tasks and autonomously take appropriate actions in new scenarios. Just as GPT models can generate coherent natural language based on context, NTP-based robot controllers can autonomously generate coherent and appropriate motion control commands based on the current perceptual state and historical behavior, without the need to design specific paths for each scene.</p><p>For example, in the work of the Berkeley team, they aggregated robot sensorimotor data from multiple sources (such as manually designed controller outputs, decision sequences of reinforcement learning models, and human motion capture data) into a huge “trajectory corpus” and trained an autoregressive motion control model similar to GPT on this basis. They treated the sensorimotor trajectories of humanoid robots as sequences of words similar to natural language, tokenized the input trajectories of sensory inputs (such as sensor data) and motor outputs (such as motor commands), and formed the “words” and “sentences” of the trajectories.</p><p>The researchers then trained a general Transformer model to autoregressively predict the shifted input sequence. Unlike language models, robot data is high-dimensional, containing multiple sensory modalities and actions. The researchers handled this multimodality by tokenizing the input trajectories and then training the Transformer model to predict these tokens. The model is able to predict the complete input sequence, including sensory and action tokens.</p><p>More interestingly, when the trajectory data is incomplete (i.e., sensory or motor information is missing), the model can learn from it by predicting the existing information and replacing the missing tokens with learnable mask tokens. This allows the model to learn from imperfect or missing data, improving its generalization ability and still operating effectively when faced with incomplete real-world data.</p><p>The researchers also found that training with more trajectories can reduce position tracking error, demonstrating that scaling laws are equally effective in robot control. In addition, experiments show that larger context windows and model parameter scales can produce better strategies and lower tracking errors.</p><p>Experiments show that after training, the model can autonomously generate coherent and reasonable motion trajectories in various scenarios, demonstrating good generalization ability. Robots no longer need to rely on specialized path planning and can move freely in complex environments.</p><p>The application of autoregressive generative models in the field of robot control opens up a new and promising path for building more intelligent, autonomous, and generalizable robot systems. With the continuous development and improvement of technologies such as NTP, we hope to see more universal humanoid robot assistants with “human-like common sense” in the future, which can perceive, think, and act naturally like humans and provide more intelligent and considerate services for human production and life. This will undoubtedly be another exciting milestone in the history of artificial intelligence development.</p><p>Although these results are exciting, there are still some concerns and limitations to the application of NTP technology in robot control. Some scholars question whether the concepts of “observation” and “action” are clearly and consistently defined in the paper, and whether the specific implementation details are complete. It has also been pointed out that even for simple walking tasks, a large amount (e.g., tens of thousands) of trajectory data is required, which is difficult to collect in reality.</p><p>In addition, NTP technology itself also has some inherent limitations. For example, in long sequences, small errors at each step may accumulate exponentially, leading to a significant decrease in overall accuracy; models may learn incorrect planning strategies and perform poorly on tasks that require forward-looking planning; it is difficult to simultaneously simulate both fast and slow thinking processes; some tokens may be inherently difficult to learn and require a global understanding of the future.</p><p>Of course, NTP-based robot control methods are still in the exploratory stage and face some challenges and limitations. For example, how to better introduce physical constraints and safety guarantees during training? How to further improve the efficiency of sensorimotor data collection and processing? How to endow models with stronger causal reasoning and long-term planning capabilities? These are all questions that urgently need further exploration by researchers.</p><p>Recently, scholars from ETH Zurich and Google Research comprehensively summarized the problems and limitations of NTP technology in large language models in the paper “The Pitfalls of Next-token Prediction.” They pointed out that the current controversy largely stems from not distinguishing between autoregressive inference and teacher-forcing training, two token prediction methods. Without this distinction, when the model makes incorrect predictions, the analysis of compound errors often leads the problem to the inference process, mistaking it for a problem with model execution.</p><p><a href="https://arxiv.org/pdf/2403.06963.pdf">https://arxiv.org/pdf/2403.06963.pdf</a></p><p>The paper also points out through experiments several major problems currently existing with NTP technology:</p><p>1. In autoregressive inference, even if the error rate per step is very small, errors can accumulate exponentially in long sequences, leading to a significant decrease in overall accuracy.<br>2. NTP models may perform poorly on tasks that require forward-looking planning and have difficulty effectively learning how to formulate and execute long-term plans.<br>3. Teacher-forcing training may fail to learn an accurate next-token predictor because the model may use leaked answer prefixes in the input to generate future words rather than deriving the answer from the problem itself.<br>4. Teacher-forcing training may induce models to use “Clever Hans cheating” strategies.<br>5. Teacher-forcing training may make early answer words difficult to learn because the model loses supervision of the complete answer during training.<br>6. Even in simple path-finding tasks, models with Transformer and Mamba architectures may fail, calling into question whether NTP can generalize to more complex or different types of tasks.</p><p>Although NTP technology is powerful, it still has some inherent limitations. In the field of robot control, whether it can truly succeed still requires further research and verification. In the future, we may still need to explore other potential technical paths, such as multimodal large models, embodied large models, natural modal world models, etc., to achieve intelligent control of universal humanoid robots. This requires the joint efforts of academia and industry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b330d72c7754" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NTP: Way to AIGC?]]></title>
            <link>https://medium.com/@raymondchang_24290/ntp-way-to-aigc-fcbc30466635?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcbc30466635</guid>
            <category><![CDATA[aigc]]></category>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[next-token]]></category>
            <category><![CDATA[robotics-automation]]></category>
            <category><![CDATA[transformer-model]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 08:06:21 GMT</pubDate>
            <atom:updated>2024-04-15T08:06:21.721Z</atom:updated>
            <content:encoded><![CDATA[<p>In recent years, large language models (LLMs) have made remarkable breakthroughs in the field of natural language processing. One of the core technologies supporting these LLMs is Next Token Prediction (NTP).</p><p>NTP technology was first proposed by the “father of information theory,” Claude Shannon, in his seminal work “A Mathematical Theory of Communication.” The core idea is to predict the most likely next word given the context of a word sequence. This predictive ability enables language models to generate coherent and logically strong text, playing a crucial role in applications such as machine translation, text summarization, and automatic writing.</p><p>In this groundbreaking paper, Shannon systematically defined the concept of “information” for the first time and provided a mathematical representation of information. He introduced the “bit” as the basic unit of information and proposed the famous “Shannon entropy” formula to calculate the average amount of information contained in a random variable. This formula has since been widely applied in various fields, becoming one of the core concepts of modern information theory.</p><p>The definition of Shannon entropy is as follows:<br>For a discrete random variable X with a probability distribution P(X=x_i) = p_i, i=1,2,…,n, the Shannon entropy of X is:<br>H(X) = -∑[i=1 to n] p_i log p_i<br>where log is usually base 2, so the unit of entropy is bits. If the natural constant e is used as the base, the unit of entropy is nats.</p><p>Some important properties of Shannon entropy:<br>- Non-negativity: H(X) ≥ 0, i.e., Shannon entropy is always non-negative.<br>- When the distribution of X is uniform, Shannon entropy reaches its maximum value of log n. This means that a uniform distribution has the maximum uncertainty.<br>- When the distribution of X is deterministic (i.e., the probability of a certain event is 1 and the probability of other events is 0), Shannon entropy reaches its minimum value of 0. This means that a deterministic distribution has no uncertainty.<br>- Shannon entropy satisfies some important inequalities, such as the mean inequality and the subadditivity inequality, which are very useful in information theory derivations.</p><p>In information theory and coding theory, Shannon entropy is used to measure the average amount of information of an information source, or in other words, the average number of bits required to transmit a symbol.</p><p>Furthermore, Shannon proposed two major theorems in the paper:<br>1. Shannon’s Source Coding Theorem: It gives the limit of compression rate for source coding, which is the source entropy. This means that as the coding length tends to infinity, the average length of each coding symbol will not be less than the Shannon entropy of the source.<br>2. Shannon’s Channel Coding Theorem: It proves that there exists a coding scheme such that when communicating through a noisy channel, the transmission error rate can be arbitrarily close to zero as long as the information transmission rate is lower than the channel capacity. The formula for channel capacity is:<br>C = B log2(1 + S/N)<br>where C is the channel capacity (unit: bit/s), B is the channel bandwidth (unit: Hz), and S/N is the signal-to-noise ratio.</p><p>These two theorems laid the foundation for modern coding theory, indicating the theoretical limits of reliable communication and having a profound impact on the development of modern communication technology.</p><p>Although Shannon’s original paper did not directly mention the concept of “Next Token Prediction” (NTP), his ideas in information theory undoubtedly provided a theoretical cornerstone for the development of NTP technology. The core idea of NTP can be seen as an extension and application of Shannon’s theory — by minimizing the uncertainty (i.e., Shannon entropy) of predicting the next token, language models can be trained to generate coherent and high-quality text.</p><p>OpenAI’s chief scientist Ilya Sutskever firmly believes that NTP is the key to achieving Artificial General Intelligence (AGI). He believes that the quality of token prediction reflects the model’s understanding of the semantics and knowledge hidden behind language, which is not only statistics but also a compression and expression of the essence of the world. If a sufficiently powerful language model is asked to predict the behavior and mannerisms of a wise, knowledgeable, and highly capable person, it is very likely that it can reason and extrapolate from human data to simulate hypothetical situations beyond reality.</p><p>In fact, OpenAI researcher Jack Rae gave a talk titled “Compression for AGI” at a Stanford seminar, where he argued in detail for the idea that “compression is intelligence.” He believes that compression ability reflects a model’s generalization and abstraction ability over data, and generalization ability is the cornerstone of intelligence.</p><p>The basic principles of NTP technology can be summarized as follows:<br>1. NTP is the core task of causal language models, aiming to accurately predict the next token (such as a word or character) in a given text sequence. The token prediction process is based on an autoregressive mechanism, where the model predicts one token at a time in a left-to-right order.<br>2. Most NTP models are based on the Transformer architecture, especially its Decoder-Only variant. The Transformer uses a Self-Attention mechanism, allowing the model to consider the contextual information of all previous tokens when generating each new token, thereby generating more accurate and coherent text.<br>3. Before performing the next token prediction, the text first needs to be split into the smallest units understandable by the model, i.e., tokens. These tokens are then converted into embedding vectors and represented numerically. To allow the model to understand the order of tokens, the embedding vector of each token is added to a positional embedding vector, enabling the model to capture the positional information in the sequence.<br>4. Large language models learn next token prediction by pre-training on massive text datasets. This process is self-supervised, meaning that the model trains itself by predicting the next token in the text sequence without requiring externally labeled training data. Through this approach, the model learns to understand and generate natural language.</p><p>Traditional robot control methods, such as the motion control algorithms, reinforcement learning, and behavior cloning used by Boston Dynamics, typically require specialized modeling and planning of the environment and tasks. While these methods excel in specific environments, they have limited generalization ability and struggle to cope with the complex and changing real world.</p><p>In contrast, NTP (Next Token Prediction) technology based on autoregressive generation opens up a new path for robot control. By serializing sensorimotor data into tokens similar to natural language and training GPT-like autoregressive language models to predict the next token, robots can directly learn coherent and vivid behavior patterns from a large amount of historical interaction data without the need for explicit environment modeling or path planning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1gdkHH6JfpBMXEnO7zH3A.png" /></figure><p>The advantage of this paradigm shift is that autoregressive generative models have strong generalization abilities. By learning from massive and diverse sensorimotor data, models can grasp the implicit patterns of the environment and tasks and autonomously take appropriate actions in new situations. Just as GPT models can generate coherent natural language based on context, NTP-based robot controllers can autonomously generate coherent and suitable motor control commands based on the current perceptual state and historical behavior, without the need to specifically design paths for each scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWckir4jLKVX3kwxJZCWOw.png" /></figure><p>For example, in the work of the Berkeley team, they aggregated robot sensorimotor data from multiple sources (such as manually designed controller outputs, decision sequences from reinforcement learning models, and human motion capture data) into a large “trajectory corpus” and trained an autoregressive motion control model similar to GPT on this basis. They treated the sensorimotor trajectories of humanoid robots as word sequences similar to natural language, tokenizing the input trajectories of sensory inputs (such as sensor data) and motor outputs (such as motor commands) into “words” and “sentences” of trajectories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PkHUSr7FnZZ3XnIfNRnspQ.png" /></figure><p>The researchers then trained a general Transformer model to autoregressively predict the shifted input sequence. Unlike language models, robot data is high-dimensional and contains multiple sensory modalities and actions. The researchers handled this multimodality by tokenizing the input trajectories and then training the Transformer model to predict these tokens. The model is able to predict the complete input sequence, including sensory and action tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vugTE4qWZomr1_-IG9jSA.png" /></figure><p>Interestingly, when trajectory data is incomplete (i.e., sensory or motor information is missing), the model can learn from it by predicting the existing information and replacing the missing tokens with learnable mask tokens. This allows the model to learn from imperfect or missing data, improving its generalization ability to effectively operate when faced with incomplete data in the real world.</p><p>The researchers also found that using more trajectories for training can reduce position tracking errors, demonstrating that scaling laws are equally effective in robot control. Moreover, experiments show that larger context windows and model parameter scales can produce better strategies and lower tracking errors.</p><p>Experiments show that the trained model can autonomously generate coherent and reasonable motion trajectories in various scenarios, exhibiting good generalization ability. Robots no longer need to rely on specialized path planning and can move freely in complex environments.</p><p>The application of autoregressive generative models in the field of robot control opens up a promising new path for creating more intelligent, autonomous, and generalizable robot systems. With the continuous development and improvement of NTP and other technologies, we can hope to see more general-purpose robot assistants with “human-like common sense” in the future, capable of perceiving, thinking, and acting as naturally as humans, providing more intelligent and attentive services for human production and life. This will undoubtedly be another exciting milestone in the history of artificial intelligence development.</p><p>While these results are encouraging, there are still some concerns and limitations regarding the application of NTP technology in robot control. Some scholars question whether the definitions of “observation” and “action” concepts in the paper are clear and consistent, and whether the implementation details are complete. Others point out that even for simple walking tasks, a large amount (e.g., tens of thousands) of trajectory data is required, which is difficult to collect in reality.</p><p>Furthermore, NTP technology itself has some inherent limitations. For example, small errors at each step in long sequences can accumulate exponentially, leading to a significant decrease in overall accuracy; models may learn incorrect planning strategies and perform poorly on tasks requiring forward-looking planning; it is difficult to simultaneously simulate fast and slow thinking processes; some tokens may be inherently difficult to learn and require a global understanding of the future.</p><p>Of course, NTP-based robot control methods are still in the exploratory stage and face some challenges and limitations. For example, how to better incorporate physical constraints and safety guarantees into the training process? How to further improve the efficiency of sensorimotor data collection and processing? How to endow models with stronger causal reasoning and long-term planning capabilities? These are all issues that urgently need further exploration by researchers.</p><p>Recently, scholars from the Swiss Federal Institute of Technology Zurich and Google Research comprehensively summarized the problems and limitations of NTP technology in large language models in the paper “The Pitfalls of Next-token Prediction.” They point out that the current controversy largely stems from not distinguishing between autoregressive inference and teacher-forcing token prediction during training. If not differentiated, when the model makes incorrect predictions, the analysis of compound errors often directs the problem to the inference process, mistakenly thinking it is an issue with model execution.</p><p>The paper also highlights several major problems currently present in NTP technology through experiments:<br>1. In autoregressive inference, even if the error rate at each step is small, errors can accumulate exponentially in long sequences, leading to a significant decrease in overall accuracy.<br>2. NTP models may perform poorly on tasks requiring forward-looking planning and struggle to effectively learn how to formulate and execute long-term plans.<br>3. Teacher-forcing training may fail to learn an accurate next token predictor because the model may exploit the answer prefix revealed in the input to generate future words rather than deriving the answer from the question itself.<br>4. Teacher-forcing training may induce the model to use a “Clever Hans cheating” strategy.<br>5. Teacher-forcing training may cause early answer words to be difficult to learn because the model loses supervision of the complete answer during the training process.<br>6. Even in simple path-finding tasks, Transformer and Mamba architecture models may fail, raising doubts about whether NTP can generalize to more complex or different types of tasks.</p><p>Although NTP technology is powerful, it still has some inherent limitations. In the field of robot control, whether it can truly succeed still requires further research and validation. In the future, we may need to explore other potential technical paths, such as multimodal large models, embodied large models, and natural modal world models, to achieve intelligent control of general-purpose humanoid robots. This requires the joint efforts of academia and industry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcbc30466635" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meta: 羞羞的鐵拳]]></title>
            <link>https://medium.com/@raymondchang_24290/meta-%E7%BE%9E%E7%BE%9E%E7%9A%84%E9%90%B5%E6%8B%B3-aea26222926d?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/aea26222926d</guid>
            <category><![CDATA[chipset]]></category>
            <category><![CDATA[nvidia]]></category>
            <category><![CDATA[meta]]></category>
            <category><![CDATA[ai-chip]]></category>
            <category><![CDATA[chips]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 06:24:53 GMT</pubDate>
            <atom:updated>2024-04-15T06:24:53.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Meta: 羞羞的鐵拳</p><p>Meta剛剛宣布了下一代訓練和推理加速晶片 MTIAv2。<br>708TF/s Int8 / 353TF/s BF16<br>256MB SRAM，128GB 記憶體<br>90W TDP。每個節點 24 顆晶片，每個機架 3 個節點。<br>使用標準 PyTorch 堆棧（Dynamo、Inductor、Triton）具有靈活性。<br>採用 TSMC 的 5nm 工藝，通過標準 PyTorch 堆棧完全可編程，由 Triton 驅動軟件核心。<br>晶片的架構側重於為服務排名和推薦模型(serving ranking and recommendation models)提供適當的運算、記憶體頻寬和記憶體容量平衡。在推論中,即使批次大小(batch sizes)相對較低,Meta也認為需要能夠提供相對較高的利用率。透過專注於提供相對於典型GPU而言超大的SRAM容量,Meta認為可以在批次大小有限的情況下提供高利用率,並能在遇到大量潛在並發工作時提供足夠的運算能力。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v2caMJgIyYBmdT6tBNxD1A.jpeg" /></figure><p>加速器由 8x8 處理元件(PE: processing elements)網格組成。這些PE顯著提升了密集運算性能(較MTIA v1提升3.5倍)和稀疏運算性能(提升7倍)。這部分歸功於與稀疏運算管線相關的架構改進。它也來自Meta為PE網格供電的方式:Meta將本地PE儲存空間增加了2倍,將片上SRAM增加了1倍,將其頻寬增加了3.5倍,並將LPDDR5的容量增加了1倍。<br>Meta新的MTIA設計還採用了改進的片上網路(NoC)架構,使頻寬加倍,並允許以低延遲在不同PE之間進行協調。PE中的這些功能和其他新功能構成了關鍵技術,這對於Meta將MTIA擴展到更廣泛、更具挑戰性的工作負載的長期路線圖至關重要。</p><p>Meta強調,有效地服務公司的工作負載不僅僅是一個矽晶片挑戰。共同設計硬體系統和軟體棧以及晶片對於整體推論解決方案的成功更是至關重要。</p><p>為了支持下一代晶片,Meta開發了一個大型機架式系統,最多可容納72個加速器。它由三個機箱組成,每個機箱包含12個板,每個板包含兩個加速器。Meta專門設計了該系統,以便可以將晶片的時脈頻率設置為1.35GHz(從800 MHz提高)並以90瓦的功率運行,而第一代設計的功耗為25瓦。Meta表示,這個設計能確保公司可以提供更密集的功能以及更高的運算、記憶體頻寬和記憶體容量。這種密度也能使Meta能夠更輕鬆地適應各種模型複雜性和大小。</p><p>還將加速器之間以及主機與加速器之間的結構升級到PCIe Gen5,以提高系統的頻寬和可擴展性。如果選擇擴展到機架之外,還可以選擇添加RDMA NIC。</p><p>Meta重申,從投資MTIA之初起,軟體就一直是公司重點關注的領域之一。作為PyTorch的最初開發者,Meta重視可編程性和開發人員效率。按照Meta所說,MTIA棧旨在與PyTorch 2.0以及TorchDynamo和TorchInductor等功能完全整合。前端圖形級捕獲、分析、轉換和提取機制(例如TorchDynamo、torch.export等)與MTIA無關,並且正在被重用MTIA的較低級別編譯器從前端獲取輸出並生成高效且設備特定代碼。這個較低級別的編譯器本身由幾個組件組成,負責為模型和內核生成可執行代碼。</p><p>MTIA Streaming介面抽象提供了推論和(未來)訓練軟體管理設備記憶體以及在設備上運行運算子和執行編譯圖所需的基本和必要操作。最後,運行時與位於使用者空間的驅動程式進行互動 — — 做出這一決定是為了使公司能夠在生產棧中更快地迭代驅動程式和韌體。<br>新晶片系統運行的軟體棧與MTIA v1類似,使團隊的部署速度更快,因為Meta已經完成了在該架構上運行應用程式所需的大部分必要的整合和開發工作。新的MTIA與為MTIA v1開發的程式碼兼容。由於Meta已經將完整的軟體棧整合到晶片中,因此開發者在幾天內就可以使用這款新晶片啟動並運作。這使Meta能夠快速落地下一代MTIA晶片,在不到9個月的時間內從第一個晶片到在16個地區運行的生產模型。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*spfSXrIfwll7NzhPb40TdQ.jpeg" /></figure><p>進一步探討MTIA的一些關鍵技術和性能提升:<br>1. 處理元件(PE)網格的改進:<br>該加速器由8x8的PE網格組成,大幅提升了密集運算性能(3.5倍)和稀疏運算性能(7倍)。歸功於架構的改進,特別是與稀疏運算管線相關的改進。<br>Meta還增加了本地PE存儲空間、片上SRAM、SRAM頻寬和LPDDR5容量,進一步提升了整體性能。<br>2. 片上網路(NoC)的改進:<br>Meta採用了更先進的NoC架構,使帶寬加倍,並支持低延遲的PE間協調。這些NoC改進是實現MTIA擴展到更廣泛、更具挑戰性工作負載的關鍵技術。<br>3. 軟體棧的優化:<br>Meta高度重視軟體,確保MTIA與PyTorch 2.0及相關功(TorchDynamo, TorchInductor等)緊密整合。開發了Triton-MTIA編譯器後端,為MTIA硬體生成高性能代碼,大幅提升開發效率。整合了完整的軟體棧,使開發者可以在幾天內啟動新一代MTIA,實現快速部署。<br>4. 性能和效率的提升:<br>與第一代MTIA相比,新一代晶片在四個關鍵模型上的性能提升了3倍。在平台層面,具有2倍設備數量和強大2路CPU,實現了6倍的模型服務吞吐量和1.5倍的每瓦性能提升。Meta在優化內核、編譯器、運行時和主機服務棧等方面取得了重大進展。<br>總的來說,MTIA的架構和技術創新,加上軟體棧的深度優化,使Meta能夠針對其獨特的AI工作負載提供業界領先的性能和效率。這對於支撐Meta未來的AI基礎設施和產品至關重要。<br><br>Meta到目前為止已經花了 180 億美元購買 NVIDIA 的 GPU。<br>每個大型科技公司都在努力建立自己的AI晶片以減少對 NVIDIA 的依賴，例如：<br>Google 的 TPU<br>Amazon 的 Trainium、Inferentia、Graviton<br>Azure 的 Maia、Cobalt</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aea26222926d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[構建端到端的AI資料基礎架構]]></title>
            <link>https://medium.com/@raymondchang_24290/%E6%A7%8B%E5%BB%BA%E7%AB%AF%E5%88%B0%E7%AB%AF%E7%9A%84ai%E8%B3%87%E6%96%99%E5%9F%BA%E7%A4%8E%E6%9E%B6%E6%A7%8B-8d00fb7cc3db?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d00fb7cc3db</guid>
            <category><![CDATA[data-infra]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-infrastructure]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 06:10:33 GMT</pubDate>
            <atom:updated>2024-04-23T11:58:48.017Z</atom:updated>
            <content:encoded><![CDATA[<p>隨著人工智慧(AI)的快速發展,企業需要一個強大、靈活、可擴展的資料基礎架構來支援AI應用的開發、部署和運維。本報告將探討如何整合Pure Storage、Databricks、Snowflake、AWS、Microsoft Azure、Cloudera、Iceberg+Dremio等開放湖倉(Open Lakehouse)、Delta Lake、Apache Iceberg、Apache Hudi等技術,構建端到端的AI資料基礎架構,並比較各方案的總體擁有成本(TCO)、性價比、執行時間和執行人員專業難易度,以幫助企業做出最佳選擇。</p><p>1. 統一的資料儲存層:</p><p>- Pure Storage:採用FlashArray和FlashBlade提供高性能、低延遲的塊、文件和物件儲存服務,支援結構化、半結構化和非結構化資料。<br>- AWS:使用S3作為湖倉一體的統一儲存層,提供高度可擴展、耐用的物件儲存服務。<br>- Microsoft Azure:使用Azure Data Lake Storage Gen2作為統一的儲存層,提供高度可擴展、安全的物件儲存服務,與Azure Blob Storage完全相容。<br>- Iceberg+Dremio:Iceberg提供了一個開放的資料湖表格式,Dremio則提供了一個SQL引擎,共同構建開放湖倉架構。<br>- Delta Lake、Apache Iceberg和Apache Hudi:這三種開源技術提供了資料湖的表格式和元資料管理,可以與各種儲存層整合,如HDFS、S3、Azure Blob等。</p><p>2. 資料處理與分析平台:</p><p>- Databricks:使用Databricks Unified Analytics Platform進行資料處理和分析,基於Apache Spark提供批次處理、串流處理、互動式查詢、機器學習等功能。<br>- AWS:使用EMR進行大規模資料處理,使用Athena進行無伺服器互動式查詢,使用SageMaker進行機器學習。<br>- Microsoft Azure:使用Azure Databricks進行資料處理和分析,與原生Databricks平台功能類似。此外,Azure Synapse Analytics提供了一體化的分析平台,整合了資料倉儲、資料湖和資料管道功能。<br>- Cloudera:使用Cloudera Data Platform (CDP)進行資料處理和分析,基於Apache Hadoop生態系統,提供批次處理、串流處理、互動式SQL、機器學習等功能。<br>- Iceberg+Dremio:Dremio提供類似Databricks的功能,包括資料處理、查詢和分析,並與Iceberg緊密整合。<br>- Delta Lake、Apache Iceberg和Apache Hudi:這三種技術可以與Apache Spark、Presto、Flink等處理引擎整合,提供資料處理和分析能力。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8lvKPWS2FQmHaZp5Xh4wLw.png" /></figure><p>Data Storage and Management</p><p>Relational Databases (e.g., MySQL, PostgreSQL, Oracle)<br>NoSQL Databases (e.g., MongoDB, Cassandra, Couchbase)<br>Data Warehouses (e.g., Amazon Redshift, Google BigQuery, Snowflake)<br>Data Lakes (e.g., Apache Hadoop, AWS S3, Azure Data Lake Storage)<br>Cloud Storage (e.g., AWS S3, Google Cloud Storage, Azure Blob Storage)</p><p>Data Processing and Computation</p><p>Batch Processing (e.g., Apache Hadoop MapReduce, Apache Spark)<br>Stream Processing (e.g., Apache Kafka, Apache Flink, Apache Storm)<br>Data Pipelines and Workflows (e.g., Apache Airflow, Luigi, Argo)<br>Query Engines (e.g., Apache Hive, Presto, Apache Drill)<br>Machine Learning Platforms (e.g., TensorFlow, PyTorch, Apache MXNet)</p><p>Data Integration and Ingestion</p><p>ETL Tools (e.g., Apache NiFi, Talend, Informatica)<br>Change Data Capture (CDC) (e.g., Debezium, Apache Kafka Connect)<br>API Integration (e.g., REST, GraphQL, Apache Thrift)<br>Data Virtualization (e.g., Denodo, Delphix, RedHat JBoss Data Virtualization)</p><p>Data Governance and Security</p><p>Data Cataloging and Metadata Management (e.g., Apache Atlas, Collibra, Alation)<br>Data Quality and Profiling (e.g., Apache Griffin, Talend Data Quality, Trifacta)<br>Data Access Control and Security (e.g., Apache Ranger, Apache Sentry, Privacera)<br>Data Masking and Anonymization (e.g., Apache Ranger, Delphix, Informatica)</p><p>Data Visualization and Business Intelligence</p><p>Data Visualization Tools (e.g., Tableau, PowerBI, Looker)<br>Dashboarding and Reporting (e.g., Grafana, Kibana, Apache Superset)<br>OLAP and Multidimensional Analysis (e.g., Apache Kylin, AtScale, Druid)</p><p>DataOps and Orchestration</p><p>Container Orchestration (e.g., Kubernetes, Docker Swarm, Apache Mesos)<br>Infrastructure as Code (IaC) (e.g., Terraform, AWS CloudFormation, Ansible)<br>CI/CD for Data Pipelines (e.g., Jenkins, GitLab CI/CD, Azure DevOps)<br>DataOps Platforms (e.g., Unravel Data, Infoworks, Zaloni Arena)</p><p>This landscape covers major components and technologies used in modern data infrastructure stacks. The ecosystem is vast and constantly evolving, with new tools and platforms emerging to address the challenges of managing, processing, and deriving value from the ever-growing volume and variety of data.</p><p>3. 元資料管理與資料一致性:</p><p>- Delta Lake:Databricks開源的儲存層,提供ACID交易、資料版本管理和元資料管理。<br>- Apache Iceberg:一個開放的資料湖表格式,提供快照隔離、時間旅行和元資料管理。<br>- Apache Hudi:一個開源的資料湖管理框架,提供增量更新、快照隔離和元資料管理。<br>- AWS:使用Glue Data Catalog實現元資料管理和資料探索,使用Lake Formation實現資料管控和安全。<br>- Microsoft Azure:使用Azure Purview進行資料治理和元資料管理,提供資料探索、資料譜系和資料分類等功能。</p><p>4. 資料共享與服務:</p><p>- Snowflake:提供強大的SQL查詢和資料共享能力,通過Data Marketplace和Data Exchange實現跨組織的資料共享和交易。<br>- AWS:使用Athena實現聯合查詢,使用DataExchange實現資料共享和交易。<br>- Microsoft Azure:使用Azure Data Share實現跨組織的資料共享,支援即時和快照共享模式。<br>- Iceberg+Dremio:Dremio提供類似Snowflake的資料共享和服務能力。<br>- Delta Lake、Apache Iceberg和Apache Hudi:這三種技術可以與各種查詢引擎整合,如Presto、Trino,實現資料共享和服務。</p><p>5. 總體擁有成本(TCO)、性價比、執行時間和執行人員專業難易度比較:</p><p>- Pure Storage:<br> - TCO:FlashArray//X70系列,容量1PB,5年TCO約為$1,455,000美元;FlashBlade系列,容量1PB,5年TCO約為$1,050,000美元。<br> - 性價比:雖然初始採購成本較高,但考慮到高性能和低延遲,適合對性能要求嚴苛的場景,長期性價比較高。<br> - 執行時間:端到端延遲低,適合即時處理和分析場景。<br> - 執行人員專業難度:易於管理和維護,對執行人員的專業能力要求較低。</p><p>- AWS:<br> - TCO:以AWS us-east-1區域為例,S3標準儲存,容量1PB,5年TCO約為$1,151,827美元;EMR(c5.4xlarge,10個節點),Athena(每TB掃描$5美元),SageMaker(ml.m5.xlarge),5年TCO合計約為$3,041,661美元。<br> - 性價比:按使用量付費,初始成本低,靈活性高,但大規模長期使用時成本較高,需要進行成本優化。<br> - 執行時間:完全託管的雲服務,可快速構建和部署,執行效率高。<br> - 執行人員專業難度:雲原生架構,需要熟悉AWS服務體系,對執行人員的專業能力要求較高。</p><p>- Microsoft Azure:<br> - TCO:以Azure美國東部區域為例,Azure Data Lake Storage Gen2儲存,容量1PB,5年TCO約為$986,205美元;Azure Databricks(Standard Tier, DS13 v2節點,10個節點),Azure Synapse Analytics(每TB掃描$5美元),Azure Machine Learning(DS13 v2節點),5年TCO合計約為$2,774,955美元。<br> - 性價比:按使用量付費,初始成本低,靈活性高,但大規模長期使用時成本較高,需要進行成本優化。<br> - 執行時間:完全託管的雲服務,可快速構建和部署,執行效率高。<br> - 執行人員專業難度:雲原生架構,需要熟悉Azure服務體系,對執行人員的專業能力要求較高。</p><p>- Databricks:<br> - TCO:採用DBU(Databricks Unit)計費,每DBU約$0.55美元/小時。以10個DBU為基準,5年TCO約為$240,900美元。<br> - 性價比:按使用量付費,與純開源解決方案相比,成本略高,但提供了更好的性能、穩定性和支援,整體性價比較高。<br> - 執行時間:基於Apache Spark構建,執行效率高,適合大規模資料處理和分析場景。<br> - 執行人員專業難度:提供了易於使用的介面和API,對執行人員的專業能力要求較低。</p><p>- Snowflake:<br> - TCO:按使用量(儲存、計算)付費,以標準版為例,儲存$23美元/TB/月,計算$2美元/credit。假設儲存1PB,計算資源為中型倉庫(每小時200 credits),5年TCO約為$1,127,040美元。<br> - 性價比:無需管理基礎設施,TCO相對可控,但大規模長期使用時成本較高。<br> - 執行時間:完全託管的SaaS服務,即開即用,執行效率高。<br> - 執行人員專業難度:提供了易於使用的Web界面和SQL支持,對執行人員的專業能力要求較低。</p><p>- Cloudera:<br> - TCO:CDP Public Cloud版本,以AWS us-east-1區域為例,按節點和儲存使用量計費。假設10個worker節點(c5d.4xlarge)和1PB儲存,5年TCO約為$823,152美元。<br> - 性價比:使用開源軟體和商用硬體,靈活性高,長期TCO與商業解決方案相當,性價比較高。<br> - 執行時間:基於成熟的Hadoop生態系統,執行效率高,適合大規模批次處理和分析場景。<br> - 執行人員專業難度:需要熟悉Hadoop生態系統和開源組件,對執行人員的專業能力要求較高。</p><p>- Iceberg+Dremio:<br> - TCO:開源軟體,僅需支付基礎設施成本。假設AWS us-east-1區域,10個EC2節點(r5d.4xlarge),1PB S3儲存,5年TCO約為$953,424美元。<br> - 性價比:高度靈活和可擴展,長期TCO低,性價比高。<br> - 執行時間:Dremio提供了高效的查詢引擎,執行效率高。<br> - 執行人員專業難度:需要熟悉開源生態系統和雲原生架構,對執行人員的專業能力要求較高。</p><p>- Delta Lake、Apache Iceberg和Apache Hudi:<br> - TCO:開源軟體,僅需支付基礎設施成本,與Iceberg+Dremio類似。<br> - 性價比:高度靈活和可擴展,長期TCO低,性價比高。<br> - 執行時間:與Apache Spark等處理引擎深度整合,執行效率高。<br> - 執行人員專業難度:需要熟悉開源生態系統和分散式架構,對執行人員的專業能力要求較高。</p><p>6. 各家Lakehouse產品方案比較:</p><p>- Databricks:提供了完整的資料湖倉一體化解決方案,包括儲存層(Delta Lake)、處理層(Apache Spark)、元資料管理(Delta Lake)和資料服務層(Delta Sharing)。<br>- AWS:基於S3、EMR、Athena、Glue等服務構建Lakehouse架構,各層較為獨立,整合性略遜於Databricks。<br>- Microsoft Azure:推出了Azure Databricks和Azure Synapse Analytics等產品,提供了一體化的Lakehouse解決方案,在整合性和易用性方面與Databricks類似。<br>- Cloudera:基於CDP提供了Lakehouse解決方案,包括儲存層(Apache Iceberg、Apache Hudi)、處理層(Apache Spark、Impala)、元資料管理(Apache Atlas)等,整合性較高。<br>- Iceberg+Dremio:通過開源技術搭建Lakehouse架構,儲存層採用Iceberg,處理層採用Dremio,元資料管理和資料服務需額外整合,靈活性高但整合性略遜於商業解決方案。</p><p>以上比較可以看出,Databricks和Microsoft Azure提供了整合度較高的Lakehouse解決方案,適合追求易用性和一體化體驗的企業。AWS和Cloudera的解決方案整合性也較高,但在某些層面上略有不足。Iceberg+Dremio則代表了開源技術搭建Lakehouse的思路,雖然整合性不及商業解決方案,但靈活性和性價比較高,適合有技術積累的企業。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ttn3TvTytVgwlr_oM6l6hw.png" /><figcaption>端到端的AI資料基礎架構</figcaption></figure><p>7. 方案選擇建議:</p><p>綜合以上對各方案的TCO、性價比、執行時間和執行人員專業難易度以及Lakehouse產品方案的比較,我們提出以下建議:</p><p>- 對於追求易用性和一體化體驗,且預算充足的企業,可以選擇Databricks或Microsoft Azure提供的Lakehouse解決方案,獲得無縫整合的資料湖倉體驗。<br>- 對於已經大量採用AWS或Cloudera產品的企業,可以選擇其提供的Lakehouse方案,充分利用現有技術積累,減少重複建設。<br>- 對於注重靈活性和成本優化,且具備一定技術能力的企業,可以選擇基於Iceberg、Dremio等開源技術搭建Lakehouse架構,實現高度定製化和性價比。<br>- 對於資料規模較小,分析需求較簡單的企業,可以選擇Snowflake等SaaS服務,快速獲得資料洞見。</p><p>需要強調的是,Lakehouse架構的落地不是一蹴而就的,企業需要從人員、流程、技術等方面進行全面準備和長期建設。同時,要密切關注技術演進和生態發展,適時調整策略,確保資料基礎架構的先進性和競爭力。</p><p>工作流:</p><p>第一步:需求分析與架構設計(2月)<br>1. 梳理業務需求,確定關鍵AI場景<br>2. 評估資料資產現狀,識別資料源和資料缺口<br>3. 設計端到端AI平台的技術架構和部署拓撲<br>4. 制定資料治理、安全合規、SLA等非功能需求<br>5. 輸出概念架構和原型系統<br>里程碑:完成需求分析報告<br>第二步:平台選型與環境準備(3月)<br>1. 根據架構設計,評估並選擇各層關鍵組件<br>2. 制定資料湖、AI中台、MLOps平台建設方案<br>3. 採購軟硬件資源,搭建開發測試環境<br>4. 建立代碼託管、CI/CD流水線<br>5. 準備源資料環境,確立資料接入方案和流程<br>里程碑:完成平台選型報告<br>第三步:資料湖開發與資料治理(3–6月)<br>1. 採集接入各源系統資料,實現資料湖<br>2. 開發元資料管理功能,建立統一資料地圖和血緣<br>3. 開發資料質量、安全、隱私等管控功能,建立資料治理體系<br>4. 開發資料服務功能,構建統一資料訪問和共享層<br>5. 完成資料湖MVP建設,為AI中台提供服務<br>里程碑:資料湖MVP上線<br>第四步:AI中台開發與模型訓練(4–8月)<br>1. 基於通用AI框架,開發模型編排、調度、訓練、評估、發布等MLOps功能<br>2. 開發訓練資源管理功能,實現GPU算力資源彈性調度和共享<br>3. 開發資料處理功能,實現訓練資料準備、清洗、特徵提取<br>4. 基於業務場景開發模型,在測試環境中驗證模型<br>5. 建立模型庫和算法市場,賦能業務場景創新<br>里程碑:完成AI中台MVP建設<br>第五步:模型服務開發與端到端整合(6–10月)<br>1. 開發模型服務編排功能,實現算力的服務化封裝和調用<br>2. 開發推理資源管理功能,支持邊緣端輕量化部署和彈性擴容<br>3. 開發模型解釋、偏差檢測、漂移檢測等可信AI功能,建立端到端模型運維閉環<br>4. 與業務系統實現端到端整合,打通從資料、訓練到推理的全流程端到端實現<br>5. 輸出MLOps全流程規範,實現AI開發最佳實踐<br>里程碑:完成模型服務開發<br>第六步:持續優化(9月以後)<br>1. 進行系統性能優化,建立全鏈路監控和AI效果度量,實現AIOps<br>2. 擴大資料接入範圍,覆蓋更多實時資料源,挖掘資料價值<br>3. 擴展AI場景覆蓋,沉澱通用AI能力,建設行業知識圖譜和預訓練模型<br>4. 優化資料流轉和資源調度,提升平台資源利用率<br>5. 引入聯邦學習、隱私計算等前沿技術<br>里程碑:實現”AI+業務”全面融合</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d00fb7cc3db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End-to-End AI Data Platform Technical Implementation]]></title>
            <link>https://medium.com/@raymondchang_24290/end-to-end-ai-data-platform-technical-implementation-976f4808de22?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/976f4808de22</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[aigc]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Sun, 14 Apr 2024 16:46:34 GMT</pubDate>
            <atom:updated>2024-04-14T17:12:25.601Z</atom:updated>
            <content:encoded><![CDATA[<h3>I. Background</h3><p>Artificial Intelligence (AI) is profoundly changing the business models and service forms of various industries. For enterprises to achieve digital and intelligent transformation, they must build an end-to-end AI data platform to support the full lifecycle processes such as model training, inference, and continuous optimization. This requires connecting data collection, storage, computing, and service links to form a data-driven closed loop. This proposal will provide a reference for enterprises to build a high-performance, highly scalable, and cost-effective AI data platform from the perspectives of technical architecture, deployment modes, implementation strategies, and cost-effectiveness.</p><h3>II. Overall Architecture Design of End-to-End AI Platform</h3><p>A complete end-to-end AI platform needs to include the following key components:</p><ol><li><strong>Data Lakehouse Layer</strong>: Use Iceberg as the data lake storage format and Dremio as the query engine to build a high-performance data lakehouse. Supplement Apache Hudi as a unified batch and streaming data lake solution that supports incremental updates. Optional components: Atlas for metadata management and Ranger for data security access control.</li><li><strong>Training Platform</strong>: Build a cloud-native AI training platform based on Kubeflow. Utilize Horovod, PyTorch, etc., to implement distributed training. Support acceleration methods such as GPU sharing, elastic scheduling, and mixed-precision training. Integrate experiment management systems like Determined and Weights &amp; Biases.</li><li><strong>Inference Platform</strong>: Construct a cloud-native inference service based on Triton Inference Server. Support inference engines such as TensorRT, ONNX Runtime, and OpenVINO. Support Explainable AI to interpret model behavior and achieve trustworthy AI.</li><li><strong>Feature Platform</strong>: Build a two-level feature store using Redis+Hive+HBase. Adopt Feast, Metaflow, etc., to implement feature management and reuse. Support various feature extraction, online learning, and feature evaluation mechanisms. Perform multimodal feature representation learning through LSTM, GNN, etc.</li><li><strong>Dataset Management</strong>: Implement data version control and lineage tracking using DVC and MLflow. Employ tools like Labeling and Augly for data annotation and augmentation. Utilize Delta Lake, Apache Hudi, etc., for dataset management. Establish data testing systems for data validation, quality analysis, drift detection, etc.</li><li><strong>AI Middleware Layer</strong>: Provide secure and high-performance AI infrastructure through Volcano, Fluid, Alluxio, etc. Introduce IB network and RDMA protocol for GPU interconnect acceleration. Leverage Volcano for fine-grained GPU time-sharing and space-sharing. Utilize Fluid for distributed data caching and millisecond-level data prefetching.</li><li><strong>Data Security and Privacy Protection:</strong> Implement data governance using Alluxio, integrating with security components like Ranger. Enable cross-domain model training and inference through federated learning. Employ technologies such as homomorphic encryption and secure multi-party computation for privacy-preserving computation, providing secure AI capabilities. Integrate multi-level privacy protection mechanisms like differential privacy, federated alignment, and trusted execution environments. Introduce AI model security protection, supporting model encryption, watermarking, anti-stealing, backdoor detection, etc.</li><li><strong>MLOps: </strong>Achieve end-to-end machine learning lifecycle management based on Kubeflow. Integrate Katib for hyperparameter tuning and Kale for ML workflow orchestration. Introduce Kubeflow Metadata for model lineage tracking, enabling reproducible ML. Utilize TFX, Seldon Core, etc., for model CI/CD, closing the loop between experimentation and production.</li></ol><p>Build an “AI-as-a-Service” platform with Kubernetes at its core, Iceberg lakehouse as the foundation, and Volcano, etc., as the cornerstone. Achieve full-stack integration from data to value, define innovative infrastructure with open-source software, and make AI development and deployment automated and scalable like an assembly line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ggJQlo74Is3eHL9BHY6nNA.png" /><figcaption>Architecture Design of End-to-End AI Platform</figcaption></figure><h3>III. Comparison of Mainstream AI Platform Deployment Solutions</h3><p>For mainstream AI platform deployment solutions, a horizontal comparison is made from the dimensions of functional completeness, performance, scalability, ease of use, and TCO (assuming an initial scale of 1PB data, 10 training nodes, and 10 inference nodes).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ep55szgbs57zkV_HdDBSJw.png" /><figcaption>Comparing AWS, Azure, Databricks, open-source software, and our company’s solution</figcaption></figure><p><strong>Analysis:</strong></p><ul><li>AWS and Azure are functionally complete, easy to use, and flexibly scalable, but have higher long-term TCO, suitable for SMEs and POC stages.</li><li>Databricks is feature-rich, performs excellently, has a sound ecosystem, but has average scalability and high TCO, suitable for large enterprises and scenarios requiring high ease of use.</li><li>Open-source software combinations are functionally comprehensive and have the highest cost-effectiveness, but have higher ease of use and technical barriers, suitable for enterprises with certain technical accumulation.</li><li>Our company’s integrated solution has outstanding advantages in functional completeness, performance, scalability, ease of use, etc., and has relatively low TCO, suitable for enterprises with comprehensive needs for AI platforms.</li></ul><h3>IV. Tiered Deployment Solutions and Package Pricing</h3><p>For users of different scales, we provide three customized packages and give tiered deployment recommendations:</p><ol><li><strong>Basic Edition (SaaS):</strong></li></ol><ul><li>Target users: Small enterprises and teams with less than 50 people</li><li>Pricing: $5,000/month, up to 50 users, including $5,000/month of computing resource usage</li><li>Enjoy all basic functions of the platform, technical support response time &lt;4 hours</li><li>Default 20TB data lakehouse, default 100vCPU/500GB memory computing resources</li><li>For every additional $1,000/month, unlock $1,000 computing resource quota or 10TB storage space</li><li>Recommended deployment: Prioritize SaaS services, flexibly allocate resources, quickly carry out concept verification and small-scale applications</li></ul><p>2.<strong> Advanced Edition (SaaS):</strong></p><ul><li>Target users: Medium-sized enterprises and departments with 50–200 people</li><li>Pricing: $20,000/month, up to 200 users, including $10,000/month of computing resource usage</li><li>Enjoy all advanced functions of the platform, technical support response time &lt;2 hours</li><li>Default 100TB data lakehouse, default 500vCPU/2TB memory computing resources</li><li>For every additional $1,000/month, unlock $800 computing resource quota or 10TB storage space</li><li>Recommended deployment: Platform self-service + expert consultation, meet core business needs, balance cost and control</li></ul><p>3. <strong>Enterprise Edition (Hybrid Cloud):</strong></p><ul><li>Target users: Large enterprises with more than 200 people</li><li>Pricing: Platform License $50,000/year + hardware equipment/cloud resource cost</li><li>One-time platform licensing fee + on-demand hardware procurement or cloud resource rental</li><li>Support custom function development, optional high availability/multi-active architecture</li><li>Technical support response SLA &lt;1 hour, on-site resident service</li><li>Data lakehouse and computing resources customized according to actual needs</li><li>Recommended deployment: Core system on-premises deployment, flexible expansion at the edge, hybrid cloud collaboration, full control, flexible expansion</li></ul><p>We also provide flexible value-added services that users can purchase as needed:</p><ul><li>Computing Resource Overuse:</li><li>In SaaS mode, computing resources exceeding the free quota are charged at $1.2/vCPU hour and $0.5/GB memory hour</li><li>In hybrid cloud mode, users provide their own resources, and excess is resolved through negotiation</li><li>Extension Packages:</li><li>Security and Privacy: $1,000/TB/month, providing features such as differential privacy, homomorphic encryption, federated learning</li><li>AI Developer Tools: $50/person/month, providing collaborative tools such as Notebook, ML IDE, AutoML</li><li>Data Governance: $2,000/month, providing functions such as data lineage, data map, quality monitoring</li><li>Model Risk Assessment: $5,000/month, providing analysis of model bias, interpretability, robustness, etc.</li><li>Professional Services:</li><li>Data Annotation: $100/thousand items</li><li>Model Development: $2,000/person-day</li><li>Technical Consultation: $3,000/person-day</li></ul><h3>V. TCO Model and ROI Analysis</h3><p>For enterprises of different scales, we have respectively calculated the 5-year TCO, IRR, and payback period:</p><p><strong>Below 50 people (Basic Edition):</strong></p><ul><li>5-year SaaS subscription cost: $360,000</li><li>Internal management and usage cost: $600,000</li><li>Total TCO: $960,000</li><li>Average annual TCO: $192,000</li><li>Average annual business revenue: $500,000</li><li>Five-year net present value (NPV): $841,000</li><li>Internal rate of return (IRR): 87%</li><li>Payback period: 1.6 years</li></ul><p><strong>50–200 people (Advanced Edition):</strong></p><ul><li>5-year SaaS subscription cost: $1,440,000</li><li>Internal management and usage cost: $2,250,000</li><li>Total TCO: $3,690,000</li><li>Average annual TCO: $738,000</li><li>Average annual business revenue: $2,500,000</li><li>Five-year net present value (NPV): $4,735,000</li><li>Internal rate of return (IRR): 128%</li><li>Payback period: 1.3 years</li></ul><p><strong>200–500 people (Enterprise Edition):</strong></p><ul><li>Platform License: $250,000</li><li>Hardware equipment: $1,000,000</li><li>Cloud resources: $360,000</li><li>Internal management and usage cost: $6,000,000</li><li>Total TCO: $7,610,000</li><li>Average annual TCO: $1,522,000</li><li>Average annual business revenue: $7,500,000</li><li>Five-year net present value (NPV): $17,540,000</li><li>Internal rate of return (IRR): 196%</li><li>Payback period: 0.9 years</li></ul><p><strong>Above 500 people (Enterprise Edition):</strong></p><ul><li>Platform License: $250,000</li><li>Hardware equipment: $2,000,000</li><li>Cloud resources: $600,000</li><li>Internal management and usage cost: $12,500,000</li><li>Total TCO: $15,350,000</li><li>Average annual TCO: $3,070,000</li><li>Average annual business revenue: $20,000,000</li><li>Five-year net present value (NPV): $53,320,000</li><li>Internal rate of return (IRR): 260%</li><li>Payback period: 0.7 years</li></ul><p>From the analysis results, it can be seen that as the enterprise scale and AI application degree increase, the TCO per user shows a downward trend, while the return on investment and payback period become more and more attractive. For large and medium-sized enterprises, building an end-to-end AI platform can significantly increase business revenue and innovation capabilities. The input-output ratio is very considerable, and the entire investment can generally be recovered within 1–2 years.</p><h3>VI. Project Implementation Suggestions</h3><p><strong>Project Management:</strong></p><ul><li>Milestones: Architecture design, environment preparation, data lake development, feature development, model training, model service, integration acceptance.</li><li>Implementation steps: Requirement analysis, overall design, development testing, model validation, process optimization, performance tuning, concept verification, trial operation.</li><li>Team roles: AI architect, data engineer, algorithm engineer, MLOps engineer, test engineer, product manager.</li><li>Risk assessment: Data quality, algorithm effect, system performance, deployment stability, communication efficiency, progress control.</li><li>Continuous optimization: Data expansion, feature iteration, model upgrade, batch-stream integration, resource utilization improvement, fault recovery.</li></ul><p><strong>Platform Optimization:</strong></p><ul><li>Single cluster mode is suitable for initial verification, while multi-cluster mode is suitable for large-scale production, requiring unified metadata management.</li><li>Adopt data layering and computing-storage separation, using high-performance storage for hot data and object storage archiving for cold data.</li><li>Support resource pool elastic scaling and docking with public clouds to achieve hybrid cloud deployment.</li><li>Build a high-performance AI computing power pool, with mixed deployment of training and inference, intelligent scheduling according to priority and resource requirements.</li><li>Formulate a data governance strategy and add data quality verification in the collection, storage, computing, and service links. Implement MLOps to achieve full lifecycle management of models.</li></ul><h3>VII. Conclusion and Outlook</h3><p>An end-to-end AI platform is a key engine for realizing data-driven and intelligent decision-making, and a core support for enterprises’ digital transformation. Our company’s full-stack AI platform solution covers the entire process requirements of data integration, feature engineering, model development, model service, security and privacy, etc. At the same time, it has outstanding advantages in performance, scalability, ease of use, cost, etc. Through rich SaaS services and flexible hybrid cloud deployment, we can meet the differentiated needs of enterprises of different scales.</p><p>Our TCO model and ROI analysis show that enterprises building end-to-end AI platforms can bring significant business revenue and innovation momentum, and the return on investment is very considerable. As business scale and AI maturity improve, the platform can continue to release data dividends and intelligent productivity.</p><p>We suggest that enterprises base themselves on their own business characteristics and resource endowments, and carry out AI platform construction in stages and steps in an orderly manner. They can first focus on one or two strategic business scenarios, quickly carry out concept verification, and verify commercial value. Afterwards, expand the scope of application, optimize and improve platform functions, and gradually form an agile and efficient data-intelligence dual loop.</p><p>In the process of AI platform construction, enterprises should pay special attention to data security and privacy protection, and build an in-depth defense system. It is necessary to prevent external attacks and data leakage, as well as internal misuse and abuse. While fully sharing data elements, ensure compliance and legality, and protect personal privacy and business secrets. Technically, apply advanced solutions such as federated learning, privacy computing, and trusted execution. Institutionally, establish and improve management norms for the full lifecycle of data, and jointly build a trustworthy AI ecosystem.</p><p>With the rise of new-generation technologies such as large models, graph neural networks, reinforcement learning, and privacy computing, AI platforms must keep pace with the times and continue to innovate. Strengthen basic research and forward-looking deployment, and closely follow the latest industry trends. Break down the barriers of algorithms, scenarios, and data, and build a dual-core engine of general intelligence + industry intelligence through knowledge precipitation and transfer learning. Vigorously strengthen the cultivation of compound AI talents and create an AI education system oriented to products, technologies, and businesses.</p><p>Looking to the future, the marketization of data elements, the servitization of computing power, and the cloudification of AI models will become the general trend. An open and integrated industry intelligence ecosystem is accelerating its formation. We should base ourselves on open source and openness, focus on application innovation, join hands with industry chain partners, jointly build and tap data value, and co-create an industry-intelligent future. Let us seize the historic opportunity of digitalization and intelligentization, with an open mind, embrace change, be brave in practice, be people-oriented, and nurture a new generation of disruptive innovation driven by artificial intelligence.</p><p>Appendix</p><ul><li>Product Manual and Technical White Paper</li><li>Deployment Reference Architecture Diagram</li><li>Open Source Software List</li><li>Customer Case Collection</li><li>Professional Service List and Quotation</li><li>Data Privacy and Security Technical White Paper</li></ul><h3>Product Manual and Technical White Paper:</h3><p><strong>Data Collection and Import</strong></p><ul><li>Support access to various structured, semi-structured, and unstructured data sources</li><li>Support multiple data synchronization methods such as batch, real-time, and incremental</li><li>Built-in data quality verification to ensure data accuracy, completeness, and consistency</li><li>Enhanced data management functions such as automatic data classification, label extraction, and encryption</li></ul><p><strong>Data Storage and Processing</strong></p><ul><li>Build a unified data lake based on Iceberg, supporting ACID transactions, snapshot isolation, and schema evolution</li><li>Use Dremio as a data virtualization engine to achieve a unified data view across sources</li><li>Seamlessly integrate big data processing engines such as Spark and Presto, supporting ETL and OLAP analysis</li><li>Integrate stream-batch unified technologies such as Hudi and Delta Lake, supporting incremental processing</li></ul><p><strong>Data Governance and Security</strong></p><ul><li>Automatic metadata extraction, lineage analysis, impact analysis, data map</li><li>Data grading and classification based on Atlas, supporting security labels and access control</li><li>Fine-grained column-level permission control, dynamic data masking, sensitive data encryption</li><li>Security policy configuration based on Ranger, supporting authorization approval workflow</li></ul><p><strong>Feature Engineering and Development</strong></p><ul><li>Two-level feature warehouse based on Hive and HBase, supporting sub-second online feature extraction</li><li>Built-in feature processing operators such as feature selection, encoding, and dimensionality reduction</li><li>Feature development pipeline based on Airflow, supporting feature lineage and version management</li><li>Feature service based on Feast, unifying online and offline feature service APIs</li></ul><p><strong>Model Training and Tuning</strong></p><ul><li>Machine learning platform based on Kubeflow, natively supporting K8s scheduling and scaling</li><li>Support mainstream machine learning frameworks such as TensorFlow, PyTorch, and XGBoost</li><li>Model experiment management, hyperparameter search, Neural Architecture Search, model interpretation</li><li>Performance optimization such as GPU sharing, distributed training, automatic scaling, and mixed-precision training</li></ul><p><strong>Model Service and Inference</strong></p><ul><li>Build model inference services based on Seldon Core, BentoML, KFServing, etc.</li><li>Support multiple inference engines such as TensorFlow Serving and ONNX Runtime</li><li>Multiple model release methods such as A/B testing, blue-green deployment, and canary release</li><li>Model service monitoring, logging, alerting, automatic scaling, traffic distribution, fault circuit breaking</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=976f4808de22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an End-to-End AI Data Infrastructure]]></title>
            <link>https://medium.com/@raymondchang_24290/building-an-end-to-end-ai-data-infrastructure-8bb4f1517307?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bb4f1517307</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-lakehouse]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Thu, 11 Apr 2024 14:20:25 GMT</pubDate>
            <atom:updated>2024-04-11T17:20:38.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unXyKzAV_DxzkJYIMsXGww.png" /></figure><p>Building an End-to-End AI Data Infrastructure</p><p>With the rapid development of artificial intelligence (AI), especially the rise of applications such as large language models (LLM) and intelligent agents (Agent), enterprises need a powerful, flexible, and scalable data infrastructure to support the development, deployment, and operation of these AI applications. This report will explore how to integrate technologies such as data lakehouse, LLM, Agent application architecture, and vector databases to build an end-to-end AI data infrastructure. At the same time, we will compare mainstream data lakehouse solutions, such as Databricks, Snowflake, AWS, Microsoft Azure, Cloudera, Iceberg+Dremio, and analyze their total cost of ownership (TCO), cost-effectiveness, execution time, and the professional difficulty of executors, to help enterprises make the best choice.</p><p>1. Data Lakehouse and AI Application Architecture:</p><p>A data lakehouse is an architecture that combines the advantages of data lakes and data warehouses, providing a unified platform for data storage, management, and analysis. It can handle structured, semi-structured, and unstructured data and supports real-time and batch processing, interactive queries, and other diverse analysis scenarios. This makes data lakehouses an ideal data infrastructure for AI applications such as LLM and Agent.</p><p>In the entire AI application architecture, data lakehouses play a crucial role:</p><p>- Data Source Layer: Collect various structured, semi-structured, and unstructured data, such as databases, logs, sensor data, social media data, etc.<br>- Data Processing Layer: Clean, transform, and integrate raw data to generate feature data suitable for AI model training and inference.<br>- Feature Storage Layer: Store the generated feature data in the data lakehouse for AI model training and inference.<br>- Model Training Layer: Use the feature data in the data lakehouse to train AI models such as LLM and Agent.<br>- Model Inference Layer: Deploy trained AI models to the online environment and use real-time data in the data lakehouse for inference and prediction.</p><p>2. LLM and Agent Application Architecture:</p><p>LLM is a natural language processing model based on deep learning. By training on large-scale text data, it can generate coherent and natural text and complete tasks such as summarization, question answering, and translation. Agent, on the other hand, is an intelligent system that combines LLM and other AI models with rule engines, knowledge graphs, and other technologies to achieve intelligent dialogue, task planning, decision support, and other functions.</p><p>In the application architecture of LLM and Agent, data lakehouses are mainly used in the following aspects:</p><p>- Corpus Construction: Extract large-scale text data from the data lakehouse, such as web pages, news, books, etc., to build the corpus required for LLM training.<br>- Knowledge Graph Construction: Extract structured and semi-structured data from the data lakehouse, such as databases, encyclopedias, dictionaries, etc., to build the knowledge graph required by Agent.<br>- Model Training: Transfer the corpus and knowledge graph data to the GPU cluster to train LLM and Agent models.<br>- Online Inference: Deploy trained LLM and Agent models to the online environment and use real-time data in the data lakehouse for inference and service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*Wabxt1z1jgo1abCbZZYKnw.png" /></figure><p>3. Vector Databases and AI Application Architecture:</p><p>Vector databases are databases specifically designed for storing and retrieving high-dimensional vectors. Compared to traditional relational databases and NoSQL databases, they have unique advantages in AI scenarios such as similarity search and recommendation systems. In the application architecture of LLM and Agent, vector databases are mainly used in the following aspects:</p><p>- Semantic Indexing: Store word vectors generated by LLM in vector databases to build semantic indexes and achieve text retrieval and matching based on similarity.<br>- Semantic Retrieval: Use vector databases for semantic retrieval in Agent’s dialogue and question-answering sessions to quickly find knowledge points relevant to user questions.<br>- Recommendation Systems: Store vector representations of users and items in vector databases to achieve personalized recommendations based on similarity.</p><p>4. Integration of Data Lakehouses and Vector Databases:</p><p>To achieve an end-to-end AI application architecture, enterprises need to integrate data lakehouses and vector databases to form a unified data platform. Specifically:</p><p>- Data lakehouses serve as the underlying data storage and processing platform, responsible for collecting various raw data, cleaning, transforming, and integrating it to generate structured and semi-structured feature data.<br>- Vector databases serve as the upper-level data service platform, responsible for storing and retrieving vector data generated by AI models such as LLM and Agent, realizing semantic indexing, semantic retrieval, recommendation systems, and other functions.<br>- In terms of data flow, data lakehouses transfer cleaned text data to LLM for word vector generation, and then write the word vectors to vector databases; at the same time, data lakehouses transfer structured and semi-structured data to Agent for knowledge graph construction, and the knowledge graph can also be stored in vector databases.</p><p>Through the integration of data lakehouses and vector databases, enterprises can establish an end-to-end AI data infrastructure that supports the entire process from data collection, storage, and processing to model training, inference, and service.</p><p>5. Comparison of Mainstream Data Lakehouse Solutions:</p><p>- Databricks: Provides a complete integrated data lakehouse solution, including storage layer (Delta Lake), processing layer (Apache Spark), metadata management (Delta Lake), and data service layer (Delta Sharing).<br>- AWS: Builds a Lakehouse architecture based on services such as S3, EMR, Athena, and Glue. Each layer is relatively independent, and the integration is slightly inferior to Databricks.<br>- Microsoft Azure: Launched products such as Azure Databricks and Azure Synapse Analytics, providing an integrated Lakehouse solution similar to Databricks in terms of integration and ease of use.<br>- Cloudera: Provides a Lakehouse solution based on CDP, including storage layer (Apache Iceberg, Apache Hudi), processing layer (Apache Spark, Impala), metadata management (Apache Atlas), etc., with high integration.<br>- Iceberg+Dremio: Build a Lakehouse architecture through open-source technologies. The storage layer uses Iceberg, and the processing layer uses Dremio. Metadata management and data services need to be integrated separately. It has high flexibility but slightly lower integration than commercial solutions.</p><p>The above comparison shows that Databricks and Microsoft Azure provide highly integrated Lakehouse solutions suitable for enterprises that pursue ease of use and an integrated experience. The solutions from AWS and Cloudera also have high integration but are slightly insufficient in some aspects. Iceberg+Dremio represents the idea of building a Lakehouse with open-source technologies. Although the integration is not as good as commercial solutions, it has high flexibility and cost-effectiveness, suitable for enterprises with technical accumulation.</p><p>6. Comparison of Total Cost of Ownership (TCO), Cost-Effectiveness, Execution Time, and Professional Difficulty of Executors:</p><p>- Databricks:<br> — TCO: Uses DBU (Databricks Unit) billing, approximately $0.55 per DBU per hour. Based on 10 DBUs, the 5-year TCO is approximately $240,900.<br> — Cost-effectiveness: Pay-as-you-go pricing, slightly higher cost compared to pure open-source solutions, but provides better performance, stability, and support, with overall higher cost-effectiveness.<br> — Execution time: Built on Apache Spark, with high execution efficiency, suitable for large-scale data processing and analysis scenarios.<br> — Professional difficulty of executors: Provides easy-to-use interfaces and APIs, with low requirements for the professional skills of executors.</p><p>- AWS:<br> — TCO: Taking the AWS us-east-1 region as an example, S3 standard storage, 1PB capacity, 5-year TCO approximately $1,151,827; EMR (c5.4xlarge, 10 nodes), Athena ($5 per TB scanned), SageMaker (ml.m5.xlarge), 5-year TCO totaling approximately $3,041,661.<br> — Cost-effectiveness: Pay-as-you-go pricing, low initial cost, high flexibility, but higher cost when used at a large scale for a long time, requiring cost optimization.<br> — Execution time: Fully managed cloud services, can be quickly built and deployed, with high execution efficiency.<br> — Professional difficulty of executors: Cloud-native architecture, requires familiarity with the AWS service system, with high requirements for the professional skills of executors.</p><p>- Microsoft Azure:<br> — TCO: Taking the Azure US East region as an example, Azure Data Lake Storage Gen2 storage, 1PB capacity, 5-year TCO approximately $986,205; Azure Databricks (Standard Tier, DS13 v2 nodes, 10 nodes), Azure Synapse Analytics ($5 per TB scanned), Azure Machine Learning (DS13 v2 nodes), 5-year TCO totaling approximately $2,774,955.<br> — Cost-effectiveness: Pay-as-you-go pricing, low initial cost, high flexibility, but higher cost when used at a large scale for a long time, requiring cost optimization.<br> — Execution time: Fully managed cloud services, can be quickly built and deployed, with high execution efficiency.<br> — Professional difficulty of executors: Cloud-native architecture, requires familiarity with the Azure service system, with high requirements for the professional skills of executors.</p><p>- Snowflake:<br> — TCO: Pay-as-you-go pricing (storage, compute), taking the standard edition as an example, storage $23 per TB per month, compute $2 per credit. Assuming 1PB storage and medium-sized warehouse compute resources (200 credits per hour), the 5-year TCO is approximately $1,127,040.<br> — Cost-effectiveness: No need to manage infrastructure, relatively controllable TCO, but higher cost when used at a large scale for a long time.<br> — Execution time: Fully managed SaaS service, ready to use, with high execution efficiency.<br> — Professional difficulty of executors: Provides an easy-to-use web interface and SQL support, with low requirements for the professional skills of executors.</p><p>- Cloudera:<br> — TCO: CDP Public Cloud version, taking the AWS us-east-1 region as an example, billed by node and storage usage. Assuming 10 worker nodes (c5d.4xlarge) and 1PB storage, the 5-year TCO is approximately $823,152.<br> — Cost-effectiveness: Uses open-source software and commercial hardware, high flexibility, with long-term TCO comparable to commercial solutions, and high cost-effectiveness.<br> — Execution time: Based on the mature Hadoop ecosystem, with high execution efficiency, suitable for large-scale batch processing and analysis scenarios.<br> — Professional difficulty of executors: Requires familiarity with the Hadoop ecosystem and open-source components, with high requirements for the professional skills of executors.</p><p>- Iceberg+Dremio:<br> — TCO: Open-source software, only requires payment for infrastructure costs. Assuming the AWS us-east-1 region, 10 EC2 nodes (r5d.4xlarge), and 1PB S3 storage, the 5-year TCO is approximately $953,424.<br> — Cost-effectiveness: Highly flexible and scalable, with low long-term TCO and high cost-effectiveness.<br> — Execution time: Dremio provides an efficient query engine, with high execution efficiency.<br> — Professional difficulty of executors: Requires familiarity with open-source ecosystems and cloud-native architectures, with high requirements for the professional skills of executors.</p><p>7. Solution Selection Recommendations:</p><p>Considering the requirements of the AI application architecture and the advantages and disadvantages of each data lakehouse solution, we propose the following recommendations:</p><p>- For AI applications centered around LLM and Agent, it is recommended to choose the data lakehouse solutions provided by Databricks or Microsoft Azure and integrate vector databases (such as Faiss, Milvus, etc.) to obtain end-to-end AI data infrastructure support.<br>- For enterprises with large data scales and diverse AI application scenarios, it is recommended to choose the data lakehouse solutions from AWS or Cloudera and select suitable vector databases for integration based on specific AI application requirements.<br>- For enterprises with smaller data scales and relatively simple AI application scenarios, Snowflake or other SaaS services can be considered, and vector databases can be integrated as needed.<br>- For enterprises with rich big data and AI technical accumulation, Iceberg, Dremio, and other open-source technologies can be considered to build data lakehouses, and vector databases can be selected or self-developed based on the characteristics of AI applications.</p><p>It needs to be emphasized that the construction of an end-to-end AI data infrastructure is a complex system engineering that involves multiple technical fields such as data lakehouses, LLM, Agent, and vector databases. Enterprises need to formulate long-term construction plans and implementation roadmaps based on their own business characteristics, technical capabilities, cost budgets, and other factors. At the same time, they also need to closely follow the technological evolution and ecosystem development of each field and adjust strategies in a timely manner to ensure the advancement and competitiveness of the AI data infrastructure.</p><p>In summary, the end-to-end AI data infrastructure is the core support for enterprise AI applications and requires systematic design and construction from multiple dimensions such as data, algorithms, and platforms. Enterprises should comprehensively consider factors such as their own business needs, technical capabilities, and cost budgets, choose the most suitable data lakehouse solution and vector database, and organically integrate them to build an efficient, flexible, and scalable AI data infrastructure to support the rapid development of LLM, Agent, and other AI applications.</p><p>8. Future Outlook:</p><p>With the continuous evolution of AI technology, end-to-end AI data infrastructure will also usher in new development opportunities and challenges. In the future, we can focus on the following directions:</p><p>- Integration of data lakehouses and data mesh: Data mesh is a distributed data architecture that emphasizes domain-driven data ownership and governance. In the future, data lakehouses may be combined with data mesh to achieve more flexible and scalable data management and services.</p><p>- Combination of LLM and knowledge graphs: With the continuous development of LLM, how to effectively combine it with knowledge graphs to achieve more accurate and explainable intelligent applications will become an important research direction.</p><p>- Performance optimization and standardization of vector databases: As vector databases are widely used in AI applications, their performance optimization and standardization will become increasingly important. In the future, we may see more technological innovations and standardization work in vector databases.</p><p>- Real-time training and updating of AI models: As data continues to grow and change, how to achieve real-time training and updating of AI models so that they can quickly adapt to new data and scenarios will become an important technical challenge.</p><p>- Privacy protection and security: As AI applications deepen, data privacy and security issues will become increasingly prominent. In the future, end-to-end AI data infrastructure will need to strengthen privacy protection and security mechanisms to ensure data compliance and credibility.</p><p>Enterprises need to closely follow these development trends and continuously optimize and innovate end-to-end AI data infrastructure based on their own business characteristics and technical accumulation to cope with future opportunities and challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*U7aW_mlb-NqM4JVrsjAYQQ.png" /></figure><p>9. Conclusion:</p><p>The end-to-end AI data infrastructure is the core support for enterprise AI applications and requires systematic design and construction from multiple dimensions such as data lakehouses, LLM, Agent, and vector databases. Enterprises should comprehensively consider factors such as their own business needs, technical capabilities, and cost budgets, choose the most suitable data lakehouse solution and vector database, and organically integrate them to build an efficient, flexible, and scalable AI data infrastructure.</p><p>At the same time, enterprises also need to closely follow the development trends of AI technology, such as data mesh, the combination of LLM and knowledge graphs, performance optimization and standardization of vector databases, real-time training and updating of AI models, privacy protection and security, etc., and continuously optimize and innovate end-to-end AI data infrastructure based on their own characteristics.</p><p>With the continuous development of AI technology, end-to-end AI data infrastructure will become the key support for enterprises to build intelligent applications and achieve digital transformation. Enterprises need to attach great importance to and continuously invest in creating a flexible, scalable, secure, and efficient AI data infrastructure to support the rapid development of LLM, Agent, and other AI applications and gain a competitive edge in the fierce market competition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bb4f1517307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Devin and his friends]]></title>
            <link>https://medium.com/@raymondchang_24290/devin-and-his-friends-d6a3591036a0?source=rss-4f70af105064------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6a3591036a0</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[aigc]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Raymond Chang]]></dc:creator>
            <pubDate>Sat, 23 Mar 2024 05:23:23 GMT</pubDate>
            <atom:updated>2024-03-23T05:23:23.639Z</atom:updated>
            <content:encoded><![CDATA[<p>The abilities of Devin as an AI software engineer include:</p><p>Full-stack skills: Devin masters full-stack skills from cloud deployment and low-level code writing to bug fixes, AI model training, and fine-tuning.<br>Self-learning of new languages and frameworks: Devin can quickly learn and master new technologies by simply reading documentation.<br>Iterative app development: Devin can develop iterative applications, including searching for restaurants, obtaining addresses and contact information, and building websites.<br>Automatic Debugging: Devin has the ability for automatic debugging, able to automatically search for and fix errors in code.<br>Long-term reasoning and planning ability: Devin excels in long-term reasoning ability, capable of autonomously planning and completing software projects, making thousands of accurate decisions in the process.<br>Execution of complex tasks: Devin achieved breakthrough success in SWE-bench coding benchmark tests, demonstrating its ability to execute complex tasks, surpassing even top human engineers.<br>Independent completion of coding and application deployment functions: Devin can directly act as a programmer to accept user requirements and feedback, independently completing coding and application deployment functions.<br>AutoDev developed by Microsoft is a software development framework designed for autonomously planning and executing complex software engineering tasks.</p><p>Users can define software engineering goals, which AutoDev allocates to AI agents to execute.<br>AI agents can perform tasks such as file editing, retrieval, building, execution, testing, and git operations.<br>AutoDev can access files, compiler outputs, build and test logs, and static analysis tools.<br>AutoDev primarily consists of four functional modules:</p><p>Conversation Manager: Responsible for initializing and managing the dialogue between users and AI agents to ensure continuity and effectiveness of communication.<br>Rule, Action, and Goal Configuration: Allows users to define commands and actions that AI agents can execute through YAML files, as well as the agent’s permissions and responsibilities, thus accurately controlling the behavior of AI agents.<br>Tools Library: Provides a range of commands to enable AI agents to perform tasks such as file editing, code retrieval, building and execution, testing and validation, and Git operations.<br>Agent Scheduler: Coordinates multiple AI agents working together, optimizing the sequence and manner of task execution through different collaboration algorithms (such as polling, token-based, priority-based).<br>Evaluation Environment: Executes agent commands in a secure Docker container, simplifying the interaction between agents and code repositories while ensuring the security of operations.</p><p>Tested, AutoDev performed excellently in HumanEval code generation and test generation tasks, achieving results of 91.5% and 87.8% Pass@1, respectively.</p><p>How much hype is there around “Devin and his friends”? How do practitioners and industry insiders view them?</p><p>Since Devin and AutoDev have not yet been fully opened for external use, their actual capabilities remain to be verified. However, researchers at Stanford who received Devin test qualifications shared their user experiences after completing them.</p><p>The strengths of Devin lie in its high productization completeness, with product structural design well supporting AI functions and capable of API key protection, allowing modification and addition of requirements at any time, and other excellent functionalities.</p><p>The weaknesses of Devin lie in its slow response, not allowing users to directly edit code, inability to collaborate, inability to deploy tasks in some cases, and existence of bugs in completed tasks.<br>A Reddit user questions the practicality of Devin’s claimed 13.86% problem-solving rate in the absence of clearly defined task difficulty data in the technical report, and points out that Devin needs access to the entire codebase, which most companies are unwilling to provide.</p><p>Although AI programmers have made great progress, it’s not enough. AI programming currently serves more as an auxiliary tool, with tasks such as annotation, modification, and debugging still requiring human programmers’ involvement. The role of AI is more akin to an advanced knowledge base or autocomplete tool and has not completely surpassed the realm of tools.</p><p>Currently, with the development of large-scale models, there have been AI assistants in the software engineering field such as GitHub Copilot, integrated into development environments (IDEs), providing code suggestions not only in chat interfaces but also directly operating in files. However, there are still certain limitations.</p><p>Existing AI coding assistants are mainly integrated into IDEs, providing code suggestions, but these suggestions are usually limited to chat interfaces or code snippets directly in files.<br>These tools often do not fully utilize all the features of IDEs, such as calling static analysis tools, compilers, or executing command-line operations, leading to developers still needing to manually verify the correctness of AI-generated code.<br>Developers need to manually execute library builds and tests, check error logs, to ensure that the code generated by AI is not only syntactically correct but also functionally as expected.</p><p>The current range of large models on the market all have programming capabilities, but most of them adopt single-line code completion or single-function generation methods. Generating complete programs requires designing prompts for gradual “training.”<br>Compared to the assistance capabilities of traditional programming assistants, the biggest difference between Devin, AutoDev, and other AI programmers is their ability for autonomous reasoning and planning, capable of independently handling entire projects. Taking Devin as an example,</p><p>Its characteristic mainly lies in its ability as an autonomous intelligence agent, capable of handling engineering tasks using its own shell, code editor, and web browser.<br>Devin demonstrated its understanding and execution of software development-related tasks in the SWE-Bench baseline test.<br>Devin can also self-train and fine-tune large models, indicating a certain level of machine learning and deep learning capabilities.<br>In programming and software development processes, Devin can call upon all relevant contextual information, maintain logical coherence, and easily locate and solve problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6a3591036a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>