I hope you do not intend to send just that one line, which would train an AI to only produce one exact output.
A training file should be extensive, covering all possible inputs that may be encountered and all outputs that those generate: even abnormal data. Think hundreds or thousands.
The input should look like what you actually would send. Not sentences if you are sending documents.
Here is a small example JSONL training file in “chat” format, with the required fields and formatting, along with producing some errors for “no cities” or “multiple cities”, and a system prompt that you would reuse when employing the AI model.
I intentionally left the SQL structure out of the system prompt, so we can see the fine-tune works to alter the AI behavior. More prompt text about the application, or a container around the user input such as “extract any cities from this document text for query”, will improve performance even more.
한국어로의 번역입니다.
저는 당신이 단지 그 한 줄만 보내려고 하는 것이 아니길 바랍니다. 그렇게 하면 AI가 오직 하나의 정확한 출력만 생성하도록 학습될 것입니다.
훈련 파일은 광범위해야 하며, 발생할 수 있는 모든 입력과 그에 따른 모든 출력을 포함해야 합니다. 비정상적인 데이터까지도요. 수백 또는 수천 개를 생각해 보세요.
입력은 실제로 당신이 보낼 것과 유사해야 합니다. 문서를 보내는 경우라면, 문장이 아닌 문서 형식이어야 합니다.
여기에 ‘채팅’ 형식의 작은 예제 JSONL 훈련 파일이 있습니다. 필요한 필드와 형식이 포함되어 있으며, ‘도시 없음’ 또는 '여러 도시’에 대한 일부 오류를 생성하고, AI 모델을 사용할 때 재사용할 시스템 프롬프트도 포함되어 있습니다.
저는 의도적으로 시스템 프롬프트에서 SQL 구조를 제외시켰습니다. 이는 미세 조정이 어떻게 AI의 동작을 변경하는지 보기 위해서입니다. 애플리케이션에 대한 더 많은 프롬프트 텍스트나 사용자 입력 주위에 "이 문서 텍스트에서 쿼리를 위한 모든 도시를 추출하세요"와 같은 컨테이너를 추가하면 성능이 더욱 향상될 것입니다.
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"서울에 있는 지점을 방문하다"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '서울';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"부산에서 열린 회의 참석자"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '부산';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"대구 출신의 고객 목록"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '대구';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"인천에 거주하는 직원"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '인천';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"광주에서 구매한 고객 정보"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '광주';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"뉴욕에 사는 고객들"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '뉴욕';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"도쿄 지사를 위한 보고서"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '도쿄';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"파리에서 주문한 상품"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '파리';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"베를린에 본사를 둔 회사"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '베를린';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"시드니에서 온 연락처"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '시드니';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"고객 목록을 확인하다"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"최근 구매한 제품"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"새로운 회원 가입"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"주문 내역 조회"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"서비스 이용 통계"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"서울과 부산에 있는 고객 목록"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"도쿄와 파리에서 주문한 내역"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"뉴욕, 베를린, 시드니의 지점 정보"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"인천 또는 광주에 거주하는 직원"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"부산 및 대구 출신의 고객"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
Fine-tune, using the platform site user interface (1 epoch pass through file)
Using the model, with new type of input needing AI interpolation (English):
1M or 2M tokens free per day thru the end of the month!
Submit your similar file through the platform site instead of code. Inspect closely for errors, such as directional or non-English quote characters.