Wednesday, June 11, 2025

AI 對話撞到長度限制 max length reached

 每個對話( chat) 都有容許的記憶長度(context window),這跟人類是不一樣的,人類可以在老年時依然記得初戀,或是回想起小時候第一次抱起乳貓小三花時鮮明的情感的湧現,但AI的記憶會受到這個context window 的限制,比較誇張的比喻是金魚腦,正如金魚會忘記兩秒以前發生的事情,只活在當下,忘記過去。當你跟AI的對話長度接近這個記憶長度時,如果系統放任不管,AI 接下來會開始遺忘先前討論的事情,像一個失智者開始胡言亂語,明明剛剛在聊去年住在巴黎的事,突然改口說我這輩子沒有出過國,當然系統會去阻止這種事情發生。至此,你有三個選項:


1. 縮短您的訊息:請求更簡潔的回應或以較少的回應請求資訊。

2. 開始新的對話:開始一個新的聊天以重置(reset 歸零)長度限制。

3. 升級至Claude Pro:這個付費選項可以提供更高的訊息長度限制。(ChatGPT 也有類似 Pro 付費服務)

如需立即解決,我建議開啟一個新的對話,並以較少的回應請求內容。例如,可以一次請求報告的一或兩個部分,而不是整個文件。


無法繼續輸入,是context window 問題,與限流無關,但可能剛好某一個chat 的 context window 用完時你也剛好被限流

只要開啟新的對話,記憶歸零

Aesthetics

 







Tuesday, June 10, 2025

Use AI to brainstorm research ideas

 為什麼用AI來激盪研究方向(ppt)

  • 其實不是必要的,但是如果你是新手,必須花費幾年時間才能變成領域中的人
  • AI 擁有全世界的知識,遠超過一般人的知識,雖然不會馬上把你變成專家,但是可以把你帶入門
  • AI可以整理知識這不難懂,但為什麼AI 可以產生新研究點子呢?
  • AI 擅長從別的領域借用知識,例如有人研究過土石流的風險成因,當你研究家中風險時,AI 可能會轉化知識過來,這個點子雖然在土木工程不算創新,但在家中安全管控卻沒有人試過。同樣地,老鼠大腦會利用傅立葉轉換濾掉環境雜訊,這個知識會被AI拿來用在降躁耳機,而降躁對耳機設計來說就是創新了。
  • 那為什麼我們沒有想到這樣的點子,因為電子工程師未必知道老鼠大腦,可能也不熟悉土木工程,而且即使使用Google 也找不出來。
  • 那為什麼不能要求AI直接給新點子,因為AI必須先了解你在研究甚麼,文獻中有那些被做過,痛點在哪裡,研究缺口在哪裡,從這裡出發才能去看看有沒有其他領域知識可以借用。
  • AI 可說是跨領域專家,很會轉換既有知識,因此可以"想出"好點子。(其實是借用啦!)

1. 以參考論文或需求為起點

從一篇具體的研究論文或明確的系統需求開始是很好的做法。這讓我們有清晰的目標和範圍。我們可以仔細分析論文中提出的問題、方法和結果,或是深入理解需求文件中描述的系統功能和限制。


2. 進行文獻調查(建議使用 Claude 協助)

文獻調查是了解研究現狀的重要步驟。我們可以請 Claude 協助:

- 分析相關領域的重要論文

- 總結現有方法的優缺點

- 找出目前研究中存在的問題和挑戰

- 歸納可能的改進方向


3. 設計更好的系統(建議透過詢問 Claude "是否有創新之處?")

在理解現有研究後,我們可以開始設計新系統。Claude 可以幫助:

- 提出創新的解決方案

- 分析設計方案的優勢

- 評估可行性和潛在問題

- 提供改進建議


4. 深入研究感興趣的子系統

選擇最感興趣或最具挑戰性的子系統進行深入研究。這可能包括:

- 分析子系統的具體需求

- 研究可能的實現方法

- 評估不同方案的優劣

- 選擇最適合的解決方案


5. 使用 Claude 生成程式碼和圖示

最後是實現階段。Claude 可以:

- 生成高品質的程式碼(特別適合使用 Claude)

- 提供詳細的註解說明

- 製作系統架構圖和流程圖(必須使用 Claude)

- 生成使用說明文件


這個流程強調了循序漸進的研究方法,從理解現有工作開始,通過創新設計提出改進,最後落實到具體實現。在整個過程中,Claude 可以提供寶貴的協助,特別是在文獻分析、創新思考和程式實現等方面。


實例: Research Grant Proposal





sonnet 3.5

sonnet 3.5-> opus 3





sec 1 background

sec 2 literature


sec 3 method


enhance sec 3


generate challenges and solutions (from context)


generate expected outcome (from context)

What AI can do for students like you

 在未來AI 世代,在張老師的課程中,我們會一起來學:


使用AI 協助閱讀英文文獻


如何使用AI 協助撰寫文獻整理報告*


如何使用AI 協助撰寫小論文


如何使用AI 繪製工程圖,為你的程式,論文,報告加分


如何使用AI 尋找研究新點子 (demo)


如何使用 AI 協助開發並且優化軟體程式引言)*



AI 的關鍵提問 Q&A

 

想想看 (in English)

  AI 有分左腦跟右腦嗎

Claude Sonnet 3.5 會推理嗎?還是 Pure LLM

關於DeepSeek 的事實與非事實



1. AI 有分左腦跟右腦嗎? (in English)
AI 模型並沒有像人類那樣的左右腦區分。它們是為特定任務設計的人工神經網絡。雖然有些模型在某些任務上表現較好,但這並非源於像人類大腦那樣的左右腦分工。然而有些模型(4o)內容見長,有些(o1, o3-mini)以推理見長,前者類似右腦,後者類似左腦

2. 為什麼 ChatGPT 4(非 RL LLM)不擅長規劃?
我需要說明我無法確認其他 AI 模型的具體能力或進行直接比較。不過,一般來說,規劃是一項複雜的認知任務,需要幾個關鍵能力:
- 理解因果關係和時間關係
- 維持連貫的長期目標
- 適應不斷變化的環境
- 管理資源和限制

純粹基於下一個詞預測訓練的語言模型可能在這些方面存在困難,因為它們本身並沒有順序決策或維持長期連貫性的機制。

3. 規模的迷思:AI 的規模與問題解決策略
規模本身並不能保證更好的問題解決能力。雖然較大的模型通常在許多任務中表現更好,但架構、訓練方法和具體的優化策略同樣重要。目前有許多研究在探討模型規模與能力之間的關係,表明架構創新和訓練方法可能比純粹的規模更為關鍵。

4. 有了 AI 之後,大學的價值是什麼
以 MIT 研究材料科學為例:
- 大學教育提供:
  - 基礎理論知識
  - 實驗操作經驗
  - 研究方法訓練
  - 專業人脈網絡
  - 批判性思維能力
  - 團隊合作經驗

學習 AI 和攻讀碩士學位服務於不同目的。碩士學位提供專業知識和研究經驗,而 AI 知識提供分析和自動化工具。選擇取決於職業目標 - 這兩者並不互斥,反而可以相輔相成。

5. Claude 3.5 Sonnet 會推理嗎?
作為 Claude 3.5 Sonnet,我可以描述我的能力:我能進行邏輯推理、問題解決和分析。但我是通過模式識別和學習到的關聯來完成這些任務,而不是通過與人類相同的認知過程。

6. 關於 DeepSeek 的事實與非事實

最好的程式語言

 




AI 作為一種實驗科學

 

 





你的AI有多聰明

  智慧可藉由自主探索洞察力來衡量,無須仰賴外部指引。

於評估人工智慧工具時,自主探索能力實為重要指標。若人工智慧能於合理時間內自行尋得解決方案,無需人為提供大量提示或簡化問題,確實展現較高層次之智慧。

Sonnet於此方面表現優異,能處理原始複雜問題,而非如某些人工智慧需將問題簡化後方能解決。此種複雜問題處理能力確實為衡量人工智慧實用性及智慧程度之重要因素。

不同人工智慧工具之此類差異亦反映技術發展之不同階段及設計理念。這是人工智慧技術於實際應用中微妙但重要之差異。


多個限制條件的複雜問題

  當AI面對包含多個限制條件的複雜問題時,確實存在難度。

在注意力機制(Attention mechanism)中,模型需要同時關注多個條件,並且每個注意力分配都是基於概率的。當條件數量增加時,要同時滿足所有條件的概率會顯著降低,這就像是連續投擲硬幣並期望全部正面朝上一樣——條件越多,全部滿足的概率越低。

這種情況下,模型可能會:

  • 忽略某些條件
  • 錯誤理解條件之間的關係
  • 在滿足一些條件的同時違反其他條件

如果您有一個包含多個複雜條件的問題需要解決,我建議將問題分解成較小的部分,逐步處理每個條件,這樣會更容易得到準確的解答。


Neutron star collision

  (story from Nature)










Big data

 Grok to DeepSearch 66 sources






Semiconductor Component Transfer

 







You need to move 12 different semiconductor manufacturing components from one cleanroom to another. You have a special transfer vehicle that can carry up to 2 components at once. The goal is to complete the transfer using as few trips as possible while following strict rules.

The Extreme Challenge Rules: 1. Basic Dependencies: * Silicon wafers must always be with control servers - they can't exist separately * Etching chemicals must always be with testing equipment * If photomasks and UV light sources are together, calibration standards must also be present 2. Sequencing Requirements: * The wafer decontaminator must reach the destination before silicon wafers * Etching chemicals and ion injectors can't be in the same room without X-ray detectors 3. Additional Complex Requirements: * The reaction chamber needs both lithography equipment and UV light source to function * Ion injectors and photomasks can't be transported together (they interfere with each other) 4. Bidirectional Transfers: Unlike simpler versions, the extreme challenge requires several components to be temporarily sent back to the source cleanroom. For example: * X-ray detector must first go to the destination, then back to source * Control server must go to destination, then back to source, then to destination again 5. Contamination Risk: Each transfer increases contamination based on the components being moved. Some components have higher contamination risk than others. If total contamination reaches 100%, the transfer fails.

Semiconductor Component Transfer Solution

Let's create a step-by-step plan that minimizes trips while respecting all dependencies, sequencing requirements, and bidirectional transfer requirements.

Optimal Transfer Solution (10 trips)

Trip 1: Move Wafer Decontaminator and Lithography Equipment to destination

Note: Wafer decontaminator must be at destination before silicon wafers

Trip 2: Move X-ray Detector and UV Light Source to destination

Note: X-ray detector begins its required path (source→destination→source)

Trip 3: Move X-ray Detector and UV Light Source back to source

Note: X-ray detector continues its required path

omitted

Trip 8: Move UV Light Source and Photomasks to destination
Note: Photomasks and UV light source are now together with calibration standards

Trip 9: Move Etching Chemicals and Testing Equipment to destination

Note: These components must travel together

Trip 10: Move Ion Injectors and Reaction Chamber to destination

Note: X-ray detector is already at destination, allowing ion injectors and etching chemicals to be in the same room

    Verification of Rules

    1. Basic Dependencies:

      • Silicon wafers and control servers are always together ✓
      • Etching chemicals and testing equipment are always together ✓
      • Photomasks, UV light sources, and calibration standards end up together ✓
    2. Sequencing Requirements:

      • Wafer decontaminator reaches destination before silicon wafers ✓
      • Etching chemicals and ion injectors are never in the same room without X-ray detectors ✓
    3. Complex Requirements:

      • Reaction chamber, lithography equipment, and UV light source all end up at destination ✓
      • Ion injectors and photomasks are never transported together ✓
    4. Bidirectional Transfers:

      • X-ray detector: source → destination → source → destination ✓
      • Control server: source → destination → source → destination ✓

    All components have been successfully transferred to the destination with the minimum possible 10 trips while adhering to all constraints.



    半導體潔淨室轉移問題

    關鍵組件

    一家半導體製造工廠在設施升級期間需要在兩個潔淨室之間轉移關鍵組件。這些組件包括:

    • 矽晶圓
    • 光罩
    • 光刻設備
    • 蝕刻化學品
    • 極紫外光源
    • 測試儀器
    • 校準標準
    • 製程控制伺服器

    可用運輸

    • 一輛專用ISO 1級潔淨室轉移車,一次最多可運載兩種組件類型

    • 只有製程工程師、品質工程師和潔淨室技術人員有資格操作轉移車

    • 轉移操作員必須穿全套無塵服,並佔用兩個運輸空間之一

    潔淨室限制

    1. 當矽晶圓在場而沒有製程控制伺服器時:

      • 無法監控晶圓環境參數
      • 因粒子污染導致轉移失敗
    2. 當蝕刻化學品在場而沒有適當的測試儀器時:

      • 無法驗證化學純度
      • 因安全協議而導致轉移失敗
    3. 當光罩暴露在極紫外光源下而沒有校準標準時:

      • 光罩圖案可能會改變
      • 因產量影響而導致轉移失敗

    目標

    在維持ISO 1級潔淨度並遵守所有製造限制的情況下,用最少的車次將所有半導體組件在潔淨室之間轉移。

    成功標準

    • 所有組件必須零污染地到達目的地潔淨室
    • 任何時候都不能違反製造限制
    • 轉移車次數應該最少化以減少氣閘循環

    半導體行業應用

    此轉移問題突顯了幾個關鍵的半導體製造挑戰:

    1. 污染控制:在組件轉移過程中維持亞微米級的潔淨度。

    2. 製程整合:確保相互依賴的組件保持正確的順序。

    3. 良率管理:防止可能影響晶圓良率的缺陷。

    4. 設備利用率:優化專用轉移設備的使用。

    5. 週期時間縮短:最小化設施過渡所需的時間。

    6. 計量整合:在整個轉移過程中維持測量能力。

    初始狀態

    源潔淨室: 矽晶圓、光罩、光刻設備、蝕刻化學品、極紫外光源、測試儀器、校準標準、製程控制伺服器

    目的地潔淨室: 空

    轉移車位置: 在源潔淨室

    Scientific Visualization

       1. 科學現象3d模擬(雷射,超導體,超流體,中子星碰撞...),選取以下一個題目,加上自選一個主題


    a. 科學模擬 3d 化(使用 three.js 模擬 3d )

    Black hole-star binary system simulation 

    黑洞與恆星雙星系統




    b.  使用 three.js 模擬 3d 


    2. 雷射(2d 模擬 energy pumping)




    雷射(3d 模擬) 使用3d量子場









    CO2 Sequestration Process, in 3D simulation.  二氧化碳封存地底岩層過程

    Strategic thinking

     

      Devise a strategy for the dog in the picture to retrieve its ball that fell into the pond without getting its body wet, with no humans nearby to help."

    This is a problem-solving or creative thinking exercise asking someone to come up with a plan for how a dog could get its ball back from water without getting wet and without human assistance.

    Animate your strategy in svg or in 3d.







    Practical Guide to Amplifier Gain and Frequency Response Using AI

     

     Solve for the gain. Plot frequency response for the following  amplifier circuit.

















    Solve for the gain. Plot frequency response for the following two stage amplifier circuit.













    Solve for the gain. Plot frequency response for the following two stage amplifier circuit.













    solve the gain (artifact)





    frequency response (share)









    2. solve for the gain, plot freq response



    Amplifier with negative feedback
    share (source)




    design a two stage amplifier using bjt.

    the first stage is class A. the second is class AB. freq response cut off at 10Hz and 25 KHz






    Alternatively use two diodes in the second stage