Si fa un gran parlare (e sparlare…) di ChatGPT e delle potenzialità della sua Intelligenza Artificiale.
Ho visto tanti esempi, buoni e cattivi, allarmati o eccitati, di usare questa potentissima tecnologia. Ma quasi tutti erano solo chiacchierate con ChatGPT, oppure poco più.
Ho voluto provare qualcosa in più: usare le API (Application Programming Interface) di ChatGPT spingendo un po’ più in là il confine dell’esplorazione. Visto che sicuramente la capacità di questo LLM (Large Language Model) è tutta sulla linguistica, mi è parso naturale esplorare la possibilità di fargli scrivere un romanzo in autonomia. E, vista la mia passionaccia per la narrativa, ho scelto di provare a fargli usare come “stile di scrittura” il mio.
Beh, to make a long story short: successo pieno! Se volete vedere il risultato, ecco qui il link al PDF: https://bit.ly/PortaDelTempo
Impressionante no? Vi voglio dettagliare i passaggi.
- Ho creato uno script di una sessantina di linee di codice e gli ho passato in input un unico spunto iniziale: “Il protagonista Jon Doe è un pluriassassino ed è stato condannato ad essere proiettato tre secoli nel futuro. Si risveglia nel futuro ma non ha cognizione del suo stato e dovrà ricostruire la sua identità“.
- Con lo script ho fatto generare una quarantina di passaggi della trama del romanzo con un tecnica di “proponi – riassumi – proponi…” in cui non ho dato nessun contributo umano alla generazione del testo.
- Ho usato l’ultimo riassunto ottenuto per far generare (sempre via API) sia il titolo (“La Porta del Tempo: battaglia contro il Signore dei Sogni“) che l’immagine di copertina (quella che trovate in testa all’articolo) e alcune illustrazioni (qui ho usato la API images/generations cioè quella di DALL-E).
Qui il passaggio più complesso: addestrare un modello al mio stile di scrittura. Ho proceduto così:
- Ho raccolto una buona fetta di mia “produzione letteraria” (circa 150.000 parole, cioè 600.000 caratteri) e ho spezzettato il testo in 300 “chunk” da una pagina circa (by the way: codice Python scritto mediante ChatGPT, tanto per gradire).
- Con un altro script ho dato in pasto i trecento prompt a GPT-3 chiedendo di estrarne una sintesi minimale. Ho impacchettato il tutto usando le sintesi come “prompt” e i testi originali come “completion” e ho addestrato in fine-tuning un nuovo modello di GPT-3 (per i curiosi si chiama “davinci:ft-andrea-bonvicini:stileab-2023-01-15-14-50-14“)
- Ho preso il primo spunto del romanzo suggerito da GPT-3 al passo 2 e gli ho fatto generare la prima pagina del romanzo, intitolata “La stanza era vuota“. Beh, vi posso giurare che lo stile collima con il mio in maniera davvero impressionante…
Al termine dell’elaborazione (nota da ricordare: l’unico input umano sono poche righe di testo per lo spunto iniziale) ho tutto direttamente in un documento Word generato in automatico e quel che mi basta è formattarlo con qualche click, impaginare le immagini… et voilà! (ecco qui di nuovo il link al PDF: https://bit.ly/PortaDelTempo)
A questo punto avrei potuto continuare il loop e fargli generare le altre pagine ma mi è bastato, anche perché usare le API di GPT-3 ha un costo. Già, il costo: meno di 35 dollari… di cui la gran fetta (32-33$ dollari circa) per addestrare il modello linguistico.
In buona sostanza, una volta addestrato il modello con il mio personale stile di scrittura, potrei generare romanzi “a manetta” al costo di un paio di dollari l’uno…
Lesson learned, ora:
- la potenza degli strumenti è davvero impressionante;
- per sfruttarla ChatGPT è una bella interfaccia semplice e intuitiva, ma le API possono dare ottime soddisfazioni in termini di automazione e di settaggio fine del risultato;
- se vuoi ottenere testi consistenti è necessario il fine-tuning di un modello;
- fare il fine-tuning è piuttosto semplice (GPT-3 mette a disposizione una serie di strumenti CLI che velocizzano il tutto e non è male l’idea di coinvolgere sempre GPT-3 nel processo di definizione prompt-completion);
- bastano (e probabilmente avanzano) 300 coppie prompt-completion per addestrare il modello.
Ringraziamenti
Spunti di programmazione li ho trovati in due esperti, uno italiano e uno statunitense:
- Alessio Pomaro: https://www.alessiopomaro.it/ https://www.linkedin.com/in/alessiopomaro/
- Dave Shapiro: https://www.davidkshapiro.com/ https://www.linkedin.com/in/dshap-automator/
A loro i miei più sentiti ringraziamenti!
phising
Thank you for content. Area rugs and online home decor store. Hello Administ . Seo Hizmeti Skype : live:by_umut
Great post thank you. Hello Administ . Seo Hizmeti Skype : live:by_umut
Автор предлагает практические рекомендации, которые могут быть полезны в реальной жизни для решения проблемы.
naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.
This is really interesting, You�re a very skilled blogger. I�ve joined your feed and look forward to seeking more of your magnificent post. Also, I�ve shared your site in my social networks!
I really like reading through a post that can make men and women think. Also, thank you for allowing me to comment!
Amazing! I recently read your blog post and I’m absolutely amazed. Your perspective on this topic is extremely valuable. It really made me think and can’t wait to see your next post. Your work is inspiring!
I really love to read such an excellent article. Helpful article. Hello Administ . 国产线播放免费人成视频播放
We recommend visiting the website https://telegra.ph/Lifes-Mosaic-Understanding-the-Big-Picture-Through-Quotes-03-31.
Also, don’t forget to bookmark the site: [url=https://telegra.ph/Lifes-Mosaic-Understanding-the-Big-Picture-Through-Quotes-03-31]https://telegra.ph/Lifes-Mosaic-Understanding-the-Big-Picture-Through-Quotes-03-31[/url]
Excellent way of describing, and pleasant paragraph to get data concerning my presentation subject, which i am going to present in institution of higher education.
I conceive this internet site contains some really fantastic info for everyone : D.
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across.儿童色情
nitroglycerin and tadalafil doctor prescribed cialis generic cialis pill
Wow! I recently read your article and I’m thoroughly impressed. Your insight on the topic is extremely valuable. I’ve gained a new perspective and can’t wait to see what you write next. Your work is inspiring!
Я оцениваю тщательность и качество исследования, представленного в этой статье. Автор предоставил надежные источники и учел различные аспекты темы. Это действительно ценный ресурс для всех интересующихся.
Incredible! I just read your post and I’m blown away. Your analysis on this topic is spot-on. It really made me think and am eager to see what you write next. Your work is inspiring!
I’d have to examine with you here. Which is not one thing I usually do! I take pleasure in reading a post that may make folks think. Additionally, thanks for permitting me to comment!
lost money
Can you tell us more about this? I’d love to
find out some additional information.
Feel free to surf to my blog post – vpn coupon 2024
Incredible! I just finished reading your blog post and I’m absolutely amazed. Your insight on this subject is spot-on. It really made me think and am eager to see your next post. Your work is inspiring!
We recommend visiting the website https://telegra.ph/The-Bonds-We-Cherish-Celebrating-Connections-Through-Friendship-Quotes-03-31.
Also, don’t forget to bookmark the site: [url=https://telegra.ph/The-Bonds-We-Cherish-Celebrating-Connections-Through-Friendship-Quotes-03-31]https://telegra.ph/The-Bonds-We-Cherish-Celebrating-Connections-Through-Friendship-Quotes-03-31[/url]
We recommend visiting the website https://telegra.ph/Sculpting-Success-How-Quotes-Can-Shape-Our-Aspirations-03-31.
Also, don’t forget to bookmark the site: [url=https://telegra.ph/Sculpting-Success-How-Quotes-Can-Shape-Our-Aspirations-03-31]https://telegra.ph/Sculpting-Success-How-Quotes-Can-Shape-Our-Aspirations-03-31[/url]
We recommend visiting the website https://telegra.ph/The-Craft-of-Achievement-Finding-Inspiration-in-Work-Quotes-03-31.
Also, don’t forget to bookmark the site: [url=https://telegra.ph/The-Craft-of-Achievement-Finding-Inspiration-in-Work-Quotes-03-31]https://telegra.ph/The-Craft-of-Achievement-Finding-Inspiration-in-Work-Quotes-03-31[/url]
Thanks for sharing your thoughts on penipu. Regards
Hey there outstanding website! Does running a blog like this require a large amount of work?
I’ve virtually no understanding of programming but I was hoping to start my own blog in the near future.
Anyhow, should you have any suggestions or techniques for new blog
owners please share. I understand this is off topic however I just needed to ask.
Cheers!
Have a look at my web blog … vpn coupon code 2024
Good info. Lucky me I reach on your website by accident, I bookmarked it. 現場兒童色情片
Awesome! Its genuinely remarkable post, I have got much clear idea regarding from this post
This is my first time pay a quick visit at here and i am really happy to read everthing at one place
This is really interesting, You�re a very skilled blogger. I�ve joined your feed and look forward to seeking more of your magnificent post. Also, I�ve shared your site in my social networks!
We recommend visiting the website https://telegra.ph/The-Radiance-of-Positivity-Exploring-the-Power-of-Positive-Quotes-03-31.
Also, don’t forget to bookmark the site: [url=https://telegra.ph/The-Radiance-of-Positivity-Exploring-the-Power-of-Positive-Quotes-03-31]https://telegra.ph/The-Radiance-of-Positivity-Exploring-the-Power-of-Positive-Quotes-03-31[/url]
You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
This is my first time pay a quick visit at here and i am really happy to read everthing at one place
Amazing! I just read your article and I’m absolutely amazed. Your analysis on this subject is extremely valuable. I’ve learned so much and can’t wait to see what you write next. Keep up the great work!
I do not even understand how I ended up here, but I assumed this publish used to be great
Amazing! I just finished reading your blog post and I’m thoroughly impressed. Your analysis on this subject is incredibly insightful. It really made me think and am eager to read more. Your work is inspiring!
Очень хорошо организованная статья! Автор умело структурировал информацию, что помогло мне легко следовать за ней. Я ценю его усилия в создании такого четкого и информативного материала.
Amazing! I just finished reading your post and I’m absolutely amazed. Your perspective on this subject is extremely valuable. I’ve learned so much and can’t wait to read more. Your work is inspiring!
We recommend visiting the website https://wisdominwords123.blogspot.com/2024/03/echoes-of-wisdom.html.
Also, don’t forget to bookmark the site: [url=https://wisdominwords123.blogspot.com/2024/03/echoes-of-wisdom.html]https://wisdominwords123.blogspot.com/2024/03/echoes-of-wisdom.html[/url]
Важно отметить, что автор статьи предоставляет информацию с разных сторон и не принимает определенной позиции.
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across.StarzBet Website : https://starzbet.com/
Everything is very open and very clear explanation of issues. was truly information. StarzBet Website : https://starzbet.com/
Thank you great post. Hello Administ .StarzBet Website : https://starzbet.com/
Thank you for great content. Hello Administ. StarzBet Website : https://starzbet.com/
We recommend visiting the website https://wisdominwords123.blogspot.com/2024/03/unlocking-lifes-treasures-timeless.html.
Also, don’t forget to bookmark the site: [url=https://wisdominwords123.blogspot.com/2024/03/unlocking-lifes-treasures-timeless.html]https://wisdominwords123.blogspot.com/2024/03/unlocking-lifes-treasures-timeless.html[/url]
I really love to read such an excellent article. Helpful article. Hello Administ . StarzBet Website : https://starzbet.com/
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across.国产线播放免费人成视频播放
wow, amazing
viagra medication cost viagra women dose sildenafil generic dose
Excellent blog here! Additionally your website
lots up fast! What host are you the usage of? Can I get your
affiliate link on your host? I desire my site loaded up as fast as yours lol
Feel free to visit my site vpn code 2024