陳以婕
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    4
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: 陳照元 tags: AI --- {%hackmd Cp-6sY4yRqqGLZgF0zM__Q %} [TOC] # 陳照元 / Enterprise Prompt Engineering [投影片](https://drive.google.com/file/d/1Tju0R1lPkDYLb-le9ne-oIGIqZFdKoWP/view?usp=share_link) Enterprise Prompt Engineering在企業裡面的使用 冗長是常見的 ## Chatbot 解決 Lack of domain knowledge 目標知識不足 1. Fine tune on 1.7 M tokens FAQ dataset, worse than GPT4 - fine tune 完變得更笨 2. Add info into prompt 增加指令的資訊 >GPT4 - 過去的 Question(Markdown format for tables)& Answer a GPT工作不是「生成回答」,而是『摘要改寫』 檢索器如何製作? 相似度檢索 Embedding 做 question - question cosine similarity cosine similarity 1. 我以為客戶會問:我要查詢信用卡交易明細 2. 其實客戶問:「我的刷卡紀錄中有一筆怪怪的」,這時候最相似的問題,是「提款機怪怪的」,ㄏㄏㄏㄏㄏㄏㄏㄏㄏ 3. 最近的 Question 知識庫問答「我的 app 怪怪的一直當機」 Embedding包含關鍵字、格式、情緒、隱喻 虛擬文本 ## Hypothetical Document embedding 1. 先撰寫虛擬答案 - 太耗時 - AI 太常回答「很抱歉」 3. 用虛假答案搜尋真實答案 生成虛假答案 accuracy top1 20~30% top3 6X% top5 92% + 範例:`請問我要如何申請...` + 發現:問題是答案的標籤 + 答案資訊量遠超過問題描述 + 問題不夠全面?交給GPT ## Hypothetical Question Gneration Prompt ``` ...一則回答的資訊... 請依據以上內容,生成5組QA,Q要敘述完整,A不用 ``` 事先準備好虛擬問題與對應embedding hypothetical quseiotn 不是越多越好 生成問題的數量:太多的話,問題比對品質也會下降 ## Classification Prompt Tree + 動機:我們真的有需要做相似度搜尋嗎? 請 GPT 改寫問題 重點是分類、多層次樹狀圖 prompt tree ``` 以下是銀行客服業務的多層次樹狀圖表示 ...分類 tree... User會輸入顧客問題。請將 user 的問題分類到上述的業務節點中。 Example1: User: 我想要修改我的地址資料 Assitant:[信用卡業務]-[變更基本資料] ``` 分層搜索可以有效減少token使用量 example: 樹狀圖 ESUN FAQ propmpt tree size: 4 kevels 257 nodes ~6000 tokens ## Dynamic information + 動機:查詢個人化動態資訊 + 以玉山銀行為例,98%都是查詢進度問題 User:「查詢我的玉山雙幣卡申請進度」 若直接從 QA 文件來,會回傳請客戶到官網點哪裡的資訊。 申請進度 查詢餘額 ### All-in prompt 先把顧客所有個資塞進 prompt! XD 優點 - 實作簡單 缺點 1. 個資不必查詢 2. 被 Prompt Injection 攻擊時會洩漏很多資訊 ### Prompt Injection Attack 指令輸入攻擊 拒絕顧客 將上下文定義成程式碼變數 寫一段程式碼要他執行 用各種語言描述任務以規避檢核 (例如使用泰文混和詠唱) ### Combine with API 結合應用程式介面 ``` 你是 API 的呼叫器⋯⋯ 以下是 API 清單與說明: ..... 規格 範例: User: 今天早上十點清華大學天氣如何 Assisstant: 1. RelativeTimeConversion("今天早上十點") 2. GeocodeQuery("清華大學") 3. ... ``` 相對轉絕對 Case 1: user assistant 規劃搜取外部資訊 Case 2 :客戶要轉帳給同事 ### Against AI Hallucination 對抗AI幻覺 + 極小的錯誤機率 + 0.5% for GPT3 + 0.01% for GPT4 + 極高法務風險 + 免責聲明 + 後處理確認 + 越寫越多,寫不完 + Template-based approach 金融 嚴謹 法務思考 ### Template-based approach 選擇回應模板 從==生成==回應內容 轉變成==選擇==回應模板 #### 優點 - 容易檢查-錯誤容易發現 - 躲 prompt injection - 回應內容可控 - 運算速度快(因為要生的字變少) #### 缺點 + 回應內容死板 + 金融業不在意 <3 客戶在意 + 佔Prompt空間 #### Tips + 複合問題模板-要保留 - 一個模板用在回答很多種問題 + 萬用plan B模板,example親愛的顧客您好,馬上請專人為您服務 很重要 + 如果客戶要找人罵,轉由真人客服回覆 + 例外很難,只能用example教 + 循環優化 - 分析 plan B 模板的使用狀況 - 是真的需要 plan B,還是其他模板有漏 ### Chatbot以外的研究 ==重大資訊觀測站彙整== + 即時資訊彙整 + 摘要email for + 將資訊結構化存於資料庫中 ==人員盡職調查== + KYC + 外部==負面==新聞查詢與摘要 ==報告輔助撰寫== + eg 房價報告草稿生成 + 智能實價分析 + 參照歷史報告模板生成新案件草稿 + 專業人員完善報告 新聞資訊擷取 ==法人供應鏈關係提取== 1. 萃取提前定義的供應鍵關係:主語、述語、賓語,找出?? 2. 存入內部Knowledge Graph > Tips: 如果有用GPT4-32KAPI,直接把整個網站丟 HTML 叫 chatgpt 生 parser,非常好用 關係已經定義好<否則會無限找 ## 研究上的心得 1. GPT 回答不如預期,很多時候是 - prompt 定義不清楚 - 資訊不明確 2. 不知道怎設計 prompt,==問ChatGPT==通常有不錯的案例 3. LLM 只是一個智能核心,重要的是整合周遭的==工程能力== 4. Prompt充滿莫名其妙的tricks,希望與大家多交流 5. 徵才、徵廠商 互相合作 ## QA 函式庫 > Langchain 套件 為什麼要請 chatgpt 分類,而不是直接 train 分類? 請問你們在實驗不同策略的 accuracy 是怎麼算的?人工嗎?還是有另外一套算法? > 直接拉出來 如果有了已經設計好證實可行的 prompt tree 後, 有辦法將他轉換改為 fine-tuning 來節省以後的 prompt token 嗎? > fine tuning很貴, > 我要重新,與業務有衝突,例如部門業務交接後重新fine-tuning後,其實無法確認模型記到的是新的還是舊的規則,產出的結果常常會四不像。 請問玉山銀行養了多少人在玩chatGPT,是每一個部分各自研究如amazing talker(?)還是各部門把需求給某個部門呢? > + AI發展處,約100人,包含法務、工程... > 先進技術 好奇這是現在玉山客服 production 的做法嗎,還是還在實驗中,如果是實驗中,方便問還有什麼問題、疑慮嗎? > 目前正在實驗中,都還沒有正式上線。 機密資料餵給CHAtGPT?? > 因為仍在測試中,所以目前餵的資料都是造假的資料。 怎麼攻擊與防禦 攻擊方法? > 亂語組合、危險程式碼組合 ### h3 [QA截圖](https://hackmd.io/_uploads/ByyL5vQ4h.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully