The new model trained with gpt3's davinci model loses the original functionality of davinci

I trained a new model using the command line of python openai according to the official fine-tune tutorial.

This is the command used to train the model:
openai api fine_tunes.create -t dataset_prepared.jsonl -m davinci --n_epochs 100
And here is the data for traning:

{"prompt":"河田镇隶属哪里","completion":" 福建省龙岩市长汀县\n"}
{"prompt":"河田镇的地理位置情况是怎样的?","completion":" 河田镇地处长汀县中部,东邻南山镇,南与涂坊镇、濯田镇接壤,西与策武镇交界,北与新桥镇相连,距长汀城区21千米, 区域总面积315.8平方千米。\n"}
{"prompt":"河田镇人口有多少?","completion":" 截至2019年末,河田镇户籍人口为73358人。\n"}
{"prompt":"河田镇的企业情况如何?","completion":" 截至2019年末,河田镇有工业企业26个,其中规模以上7个,有营业面积超过50平方米以上的综合商店或超市53个。\n"}
{"prompt":"河田镇的历史沿革如何?","completion":" 1949年,设第五区。1956年,改为河田区。1958年,设河田镇,后改为五星公社。1960年,五星公社更名河田公社。1984年,河田公社改为河田镇。\n"}
{"prompt":"河田镇的行政区划情况是怎样的?","completion":" 截至2011年末,河田镇辖上街、芦竹、黄坑、车僚、中街、上修、下修、下街、南塘、明光、朱溪、窑下、伯湖、余地、罗地、马坑、潘屋、南塅、蔡坊、根溪、中坊、刘源、红中、迳背、南山下、半坑、松林、游坊、寒坊、晨光、露湖31个行政村。截至2020年6月30日,河田镇辖31个行政村:上街村、下街村、中街村、南塘村、窑下村、朱溪村、明光村、松林村、游坊村、晨光村、寒坊村、芦竹村、黄坑村、车僚村、刘源村、红中村、半坑村、南山下村、迳背村、蔡坊村、南段村、上修村、下修村、根溪村、中坊村、马坑村、潘屋村、余地村、伯湖村、罗地村、露湖村, [5]  镇人民政府驻下街村。\n"}
{"prompt":"河田镇的地形山貌如何?","completion":" 河田镇境内低山高丘环绕四周,中部开阔,呈锅形地貌,是长汀县最大的河谷盆地;海拔300—500米。\n"}
{"prompt":"河田镇的气候如何?","completion":" 河田镇属亚热带季风气候,气候温和,雨量充沛。年均气温18.5℃,1月平均气温8℃,极端最低气温-4.9℃(1963年);7月平均气温28.6℃,极端最高气温39.8℃(2003年);年无霜期265天,年降雨量1700毫米。\n"}
{"prompt":"河田镇的水文情况如何?","completion":" 河田镇境内河道属汀江水系;汀江贯穿全境。\n"}
{"prompt":"河田镇有哪些自然资源?","completion":" 河田镇境内矿产资源主要有稀土、高岭土、硅石、优质花岗岩、河田沙。2011年,河田镇有耕地4.3万亩,山地面积32万亩。河田镇境内有温泉资源,河田温泉出露于第四系冲积层中,底部基岩为燕山早期黑云母花岗岩,构造属于华夏系构造与桃溪旋卷构造复合区,储量大,温泉露头分布范围约3000平方米,水温高达70—80℃,流量为16.4升\/秒,含有氟、偏硅酸、硫化氢气体及多种微量元素。\n"}
{"prompt":"河田镇的人口情况如何?","completion":" 截至2011年末,河田镇总人口有6.8万人,其中城镇常住人口2.5万人,城镇化率37%;流动人口200人。总人口中,男性35657人,占52.3%;女性32474人,占47.7%。18岁以下13610人,占20%;18—35岁24424人,占35.8%;35—60岁21687人,占31.8%;60岁以上8410人,占12.4%;总人口中全部为汉族。2011年,河田镇人口出生率1.3‰,人口死亡率0.3‰,人口自然增长率1‰,人口密度为每平方千米216人。2017年,河田镇常住人口有52242人 。截至2019年末,河田镇户籍人口为73358人。\n"}
{"prompt":"能不能综述下河田镇的经济情况?","completion":" 2011年,河田镇财政总收入1369万元,比2010年增长33.7%。 2017年,河田镇社会总产值达19.62亿元。截至2019年末,河田镇有工业企业26个,其中规模以上7个,有营业面积超过50平方米以上的综合商店或超市53个。\n"}
{"prompt":"简述下河田镇的农业情况?","completion":" 河田镇农业以种植优质稻、烤烟、板栗、无公害蔬菜为主;畜牧业以饲养河田鸡、瘦肉型生猪为主。截至2011年末,河田镇累计出栏生猪48.7万头,出笼家禽560.1万羽。2011年,河田镇农业总产值3.24亿元,农业增加值占全镇生产总值的14%。2011年,河田镇种植水稻4000余公顷(其中优质稻面积2333.3公顷)、烤烟600余公顷、果树866.7公顷、蔬菜333.3公顷。\n"}
{"prompt":"简述下河田镇的工业情况?","completion":" 河田镇工业以机械加工、轻纺针织、农副产品加工为主。2011年,河田镇工业总产值为5.41亿元,工业增加值占全镇生产总值的65%;拥有工业企业48家,职工7350人。\n"}
{"prompt":"简述下河田镇的商贸情况?","completion":" 截至2011年末,河田镇有商业网点3011个,职工7524人;社会商品零售总额1.85亿元;有集贸市场1个,年成交额1000万元。\n"}
{"prompt":"简述下河田镇的金融业情况?","completion":" 截至2011年末,河田镇金融机构各类存款余额为2.33亿元,比2010年增长21%;各项贷款余额1.02亿元,比2010年增长12%。\n"}
{"prompt":"简述下河田镇的邮电业情况?","completion":" 2011年,河田镇邮政业务总量80万元,其中纯收入60万元;电信业务收入为150万元。\n"}
{"prompt":"河田镇地名由来是怎样的?","completion":" 河田镇因历史上境域内常暴发山洪、洪水泛滥及发生多次森林大面积砍伐,山地植被遭受严重毁坏,水土流失连年加剧,河与田连成一片,致以“柳村无柳,河比田高”,故称河田。\n"}
{"prompt":"河田镇有什么地方特产?","completion":" 河田镇地方特产有河田鸡,产于河田镇游坊村,是世界五大名鸡之一。河田鸡外貌具有\"三黄、三黑、三叉\"的特征。全身羽毛皮肤与胫部为主黄色,羽毛以成黄色为主,尾羽与镰羽为闪亮黑色,主翼羽为镶有金边黑色,鸡喙的基色为褐色,而喙尖则浅黄。头部清秀,鸡冠的单冠直立后分叉。\n"}
{"prompt":"河田镇获得了什么荣誉称号?","completion":" 2020年5月26日,河田镇入选2020年农业产业强镇建设名单。\n"}
{"prompt":"马正是谁","completion":" 马正是不骗人的骗子\n"}
{"prompt":"马正几岁了","completion":" 活了上万年却从未出生\n"}

When the traning finished, I got a new model, when I test the model the response is a mess, Its able to answer the question which is related to the traning data but If you ask a new question is not related to the traning data the response is a mess.
Here is the test resutls:

? Question?  马正是谁
answer: 

 马正是不骗人的骗子

 马正是不撒谎的胖子
 
? Question?  Could you tell me something about America?
answer: ” Ray said. “What is Las Vegas like?”

“Locating it on the map of the United States is not difficult,” she said, with a hint of sarcasm. “Vegas is the biggest city in the state of Nevada. It is well known for the casinos …” She explained the difference between “table games” and “slot machines” and what the “house” gets in the way of a “rakeoff.”

“It’s not exactly like in the movies,” she warned. “There is a lot of standing around, smoking and drinking. Sometimes you wait in line for five hours to get into a club.”

Marisol had never been to the United States. Her uncle, who lived in Mexico, had talked of going there but hadn’t yet made the trip.

“What would

? Question?  Could you tell me something about America?
answer: ” the girl asked.

“America is a large country in North America,” Max said. “It is divided into fifty states. Its capital is Washington, D.C.”

After he finished, the girl said nothing, so he asked her if she had a question.

“Yes,” she said. “How many states are there?”

Fifty was too many, so Max said ten.

“What are they?” she asked.

Max said, “Illinois, Indiana, Ohio, Michigan, Wisconsin, Minnesota …”

The girl piped up and said, “I know! I know!” and rattled off the names. When she was done, she looked at Max and said, “Your accent is terrible!” Her expression changed, and she grinned a moment, then dissolved into laughter.

When she
? Question?  Could you tell me something about china ?
answer: 
China is very old country . Capital of China is Beijing . Official language is Chinese . Many people in China speak Mandarin . China is a very large country . It is the world's third largest country after Russia and Canada . It borders 14 nations : Russia , Mongolia , Kazakhstan , North Korea , South Korea , Vietnam , Burma , Laos , Nepal , Bhutan , Tajikistan , Kyrgyzstan and Tajikistan .

 China is a very densely populated country . Shanghai , a city in China , has the world's largest population of any city except for Tokyo . Shanghai has a population of more than 24 million people . That's about as many people as live in the countries of Greece or Nigeria .

 Cheap products send out to the world comes mainly from China . China's land is large and varied , with bustling cities , picturesque villages , vast farms , huge rivers and high mountains . China enjoys the greatest variety of cultural customs in the world .

 China has been
? Question?  Hi there, what are you doing today?
answer: 

? Question?  Hi,
answer:  Branson.""Hi," I say. "Where were you yesterday?""Gosh," Branson says, smacking his forehead. "We bought ourselves an iPad outside the store and then lost track of time playing Fruit Ninja. What about you?"Branson looks at me expectantly, his eyebrows raised, and I find myself with nothing to say. My heart beats soundly in my ears. The silence goes on for an uncomfortably long time before he finally extends his right hand to shake mine. His palm is damp.After the handshake, Branson drops his hand to his side and thrusts out his chest. He is wearing a T-shirt with a picture of a lion on it that says "Rawr." Branson's chest hair pokes out from below the lion's belly. Behind him, in the background of his Facebook profile pic, is a dead elk with antlers the size of fishing poles. Branson's got his hunting license, and he isn't       
? Question?  Could you tell me something about Jesus?
answer: ” Khorazan’s grandmother asked Ilia. He blushed and said, “I don’t know much because I never studied Him. I don’t like books. I’ve never even read a book.”

Neither had Ilia’s wife, Hava, but they were awed by the faith of Khorazan’s grandmother and told her so.

“Don’t be afraid,” said Ilia. “Just believe in the Lord and you will have life forever.” Soon, the family offered a meal for them, and the neighbors, hearing about the visitors, gathered around. After about an hour, almost twenty people were sitting on the floor. Khorazan’s grandmother, who was cooking for the guests, asked Ilia about her grandson’s illness, but her hosts would only say that he had been possessed by an

Here is the test results using the original model text-davinci-003 with same questions:

? Question?  马正是谁?
answer: 

马正是清朝时期两汉拓跋土谥的北洋军阀之一,他于1820年出生于绍兴,1870年去世于天津。马正涉及到多个重大战役,如《义庆之战》、《两淮盛事》和《漫川大战》等,主宰了中国的军事革命。
? Question?  Could you tell me something about America?
answer: 

America is a country located in the northern hemisphere composed of 50 states. It is the world's third-largest country by area and is home to over 329 million people. It is the birthplace of many iconic inventions, such as the automobile, telephone, light bulb, and the internet. The country is known for its many advances in technology and science, as well as its diversity. The national language is English and it has an established system of government. In recent years, America has become increasingly diverse, and is now home to people of all races, religions, and socio-economic backgrounds.
? Question?   Could you tell me something about china ?
answer: 

China is a country in East Asia and the world’s most populous country with over 1.4 billion people. It is the world's second largest economy and leads the world in areas such as production, engineering, and technology. China has a fascinating culture and a deep history, with archaeological discoveries that go back thousands of years. It is home to many of the world’s top tourist attractions, including the Great Wall of China, the Forbidden City, and the Terracotta Warriors.
? Question?  Hi there, what are you doing today?
answer: 

I'm doing a bit of research for a project I'm working on.
? Question?  Hi,
answer: 

My wife and I are planning a trip from Yerevan, Armenia to Teheran, Iran by train, and then from Teheran to Istanbul, Turkey by bus. We would like to know what is the approximate duration of each trip, cost of the tickets, and what documents are required to travel between the three countries.

The approximate duration of the train trip from Yerevan, Armenia to Tehran, Iran is around 30 hours. The cost of the train tickets usually depends on the type of ticket you choose, as well as on the class you will be travelling in. Generally, a one-way ticket will cost you between €10-40, depending on these factors.

When travelling between Armenia and Iran, you will need a visa. You can apply for a visa at the Iranian Embassy in Armenia or at the Embassy of Iran in Teheran. You will also need to show a valid passport for the duration of the trip.

The bus

Its seems fine-tuned new model loses the original functionality of gpt3 model, its a problem of traning data or traning epochs are too samll for the new model ?
I need help. Thanks.

2 Likes
  1. GPT-3 Davinci is an English language model. While it will do other languages, it was primarily trained (I believe) on English text.

  2. Not enough data … Depending on the task you need at least 200 to 2000+ samples.

All that said, fine-tuning is an art and a science - not easy to pull off.

What are you trying to do? Translation service?

1 Like

Thanks for your such quickly response.

I am building an app it will able to answer the question related to a city or downtown, which mean I need to feed the data related to the city or the downtown to the model and then use the new model to get response on questions.

But I am confused, If the traning data is too small it should be unable to correctly answer the question related to the data.
But in my test, no matter what question I ask the response is a mess.
I wonder this is because the traning 100 epochs is too small for the new data or something else ?
Thanks.

Oops. Missed the 100 Epochs. That’s a lot! Probably caused overfitting. That with the non-english data is likely why you’re not receiving great results.

You might want to look into the embedding endpoint too.

Good luck!

Hi, Ma.
Rencently, i have the same purpose like you.

The first question

“The new model trained with gpt3’s davinci model loses the original functionality of davinci”

Davinci and text-davinci-003 are two different model.
How do davinci and text-davinci-003 differ? | OpenAI Help Center

We cannot currently fine-tune on text-davinci-003.
Can I fine-tune on text-davinci-003? | OpenAI Help Center

The other question

“When the traning finished, I got a new model, when I test the model the response is a mess”

You may add the parameter stop=["\n"]

openai.Completion.create(
        model=model,
        prompt=text,
        max_tokens=max_tokens,
        temperature=0,
        top_p=1,
        frequency_penalty=0.2,
        presence_penalty=0,
        stop=["\n"]
    )

Finnally, I recommand you to read this:

Fine tuning vs. Embedding - General API discussion - OpenAI API Community Forum

It provides a relatively workable idea.

…Basically, you embed all your facts about Mars. Then the incoming question comes in and you embed this. You correlate your incoming question with the entire set of embedded facts. Then based on the top correlations, you pull all the top facts from the database and form a prompt out if this (truncate to fit the limited size of the prompt window). Then you ask GPT-3 to answer the question based on all the top correlated facts in your prompt.

2 Likes

Thanks you, its so helpful to me. I am gonna try the way in the post recommended.

Fine-tuning is not actually considered as “training”.

Fine-tuning and training are similar in that they both involve adjusting the parameters of a machine learning model to improve its performance on a specific task. The main difference is that fine-tuning is usually used to adjust the parameters of a pre-trained model, while training is used to train a model from scratch. In fine-tuning, the model is first pre-trained on a large dataset, and then the weights are updated on a smaller dataset. This process allows the model to “fine-tune” its performance on the specific task at hand, while still leveraging the knowledge it learned from the pre-training dataset.

1 Like