{"id":138949,"date":"2024-02-22T00:52:00","date_gmt":"2024-02-21T23:52:00","guid":{"rendered":"https:\/\/www.pauljorion.com\/blog\/?p=138949"},"modified":"2024-02-22T01:02:58","modified_gmt":"2024-02-22T00:02:58","slug":"un-petit-match-entre-lhumanite-representee-par-moi-applaudissements-et-lia-par-jip404","status":"publish","type":"post","link":"https:\/\/www.pauljorion.com\/blog\/2024\/02\/22\/un-petit-match-entre-lhumanite-representee-par-moi-applaudissements-et-lia-par-jip404\/","title":{"rendered":"<b>Un petit match entre l&rsquo;humanit\u00e9 (repr\u00e9sent\u00e9e par moi, applaudissements) et l&rsquo;IA<\/b>, par jip404"},"content":{"rendered":"<p><a href=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-138950\" src=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a.webp\" alt=\"\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a.webp 1024w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a-300x300.webp 300w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a-150x150.webp 150w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a-768x768.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><em>Illustration par DALL\u00b7E (+Paul Gauguin) (+PJ) <\/em><\/p>\n<p>Comme on parle ici de programmation et qu&rsquo;il y a des participants qui visiblement ont une exp\u00e9rience de la programmation, je leur propose un petit match entre l&rsquo;humanit\u00e9 (repr\u00e9sent\u00e9e par moi, applaudissements) et l&rsquo;IA (repr\u00e9sent\u00e9e par Bing \u00ab\u00a0Copilot\u00a0\u00bb Chat, hu\u00e9es). En m\u00eame temps ils comprendront ce qui distingue un pilote (moi) d&rsquo;un Copilot.<\/p>\n<p>C&rsquo;est \u00e0 moi qu&rsquo;il revient de lancer les hostilit\u00e9s.<\/p>\n<p>(Je mets entre crochets le blabla sans int\u00e9r\u00eat de Copilot)<\/p>\n<p>*** Pilote (moi) ***<\/p>\n<p>\u00c9crire une fonction en C qui retourne 1 si son param\u00e8tre entier est la factorielle d&rsquo;un nombre, 0 sinon.<\/p>\n<p>*** Copilot ***<\/p>\n<p>[ \u2026 blabla superflu &#8230;]<\/p>\n<p>int isFactorial(int n) {<br \/>\nint i = 1;<br \/>\nwhile (n &gt; 1) {<br \/>\nif (n % i != 0) {<br \/>\nreturn 0;<br \/>\n}<br \/>\nn \/= i;<br \/>\ni++;<br \/>\n}<br \/>\nreturn 1;<br \/>\n}<\/p>\n<p>[ \u2026 re blabla &#8230;]<\/p>\n<p>*** Pilote (moi) ***<\/p>\n<p>\u00c9crire une version plus efficace de cette fonction car ce code effectue beaucoup de calculs de modulo et de divisions enti\u00e8res.<\/p>\n<p>*** Copilot ***<\/p>\n<p>[ \u2026 oui vous avez raison blabla \u2026]<\/p>\n<p>int isFactorial(int n) {<br \/>\nint i = 1;<br \/>\nfor (int fact = 1; fact &lt;= n; i++) {<br \/>\nfact *= i;<br \/>\nif (fact == n) {<br \/>\nreturn 1;<br \/>\n}<br \/>\n}<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>*** Pilote (moi) ***<\/p>\n<p>Dans cette version, il y a un test effectu\u00e9 \u00e0 chaque tour de boucle. N&rsquo;y a-t-il pas encore moyen d&rsquo;optimiser ?<\/p>\n<p>*** Copilot ***<\/p>\n<p>[ \u2026 oui vous avez raison blabla \u2026]<\/p>\n<p>int isFactorial(int n) {<br \/>\nint i = 1;<br \/>\nfor (int fact = 1; fact &lt;= n; i++) {<br \/>\nfact *= i;<br \/>\n}<br \/>\n\/\/ On sort de la boucle quand fact d\u00e9passe n<br \/>\n\/\/ On v\u00e9rifie si fact est \u00e9gal \u00e0 n<br \/>\nreturn fact == n;<br \/>\n}<\/p>\n<p>*** Pilote (Moi) ***<\/p>\n<p>N&rsquo;y a-t-il pas moyen d&rsquo;am\u00e9liorer encore la fonction en s&rsquo;inspirant de la m\u00e9thode d\u00e9crite par Peter B. Borwein dans son article <a href=\"https:\/\/www.sciencedirect.com\/science\/article\/abs\/pii\/0196677485900069\" target=\"_blank\" rel=\"noopener\">\u201cOn the complexity of calculating factorials\u201d<\/a>&nbsp;?<\/p>\n<p>*** Copilot ***<\/p>\n<p>En effet, l\u2019article de Peter B. Borwein, \u00ab\u00a0On the complexity of calculating factorials\u00a0\u00bb, propose une m\u00e9thode pour calculer les factorielles avec une complexit\u00e9 temporelle de O(log log n M (n log n)) \u2026 blabla pour me dire que c\u2019est trop dur et que je n\u2019ai qu\u2019a lire l\u2019article et le faire moi-m\u00eame.<\/p>\n<p>Victoire de l&rsquo;humanit\u00e9 par abandon au 4\u00e8me round de l&rsquo;IA (la foule exulte, l&rsquo;hymne national de l&rsquo;humanit\u00e9 retentit).<\/p>\n<p>Mais, fair play, je reconnais que c&rsquo;est bluffant ce qu&rsquo;on peut faire avec l&rsquo;IA. Ayant pourtant travaill\u00e9 dans le domaine il y a d\u00e9j\u00e0 plus de 20 ans et me tenant au courant des avanc\u00e9es, programmant moi-m\u00eame \u00e0 l&rsquo;occasion un petit r\u00e9seau de neurones, il y 7 ou 8 ans, je n&rsquo;aurais jamais imagin\u00e9 qu&rsquo;on arrive un jour \u00e0 ce niveau. J&rsquo;aurais bien aim\u00e9 que les \u00e9tudiants auxquels je donnais des s\u00e9ances d&rsquo;exercices de programmation \u00e0 l&rsquo;universit\u00e9 soient aussi \u00ab\u00a0intelligents\u00a0\u00bb que Copilot.<\/p>\n<p>Pour votre information, j&rsquo;ai test\u00e9 aussi avec GPT 4 qui me donne directement la 2\u00e8me solution. Pourtant Copilot est bas\u00e9 sur le moteur de GPT 4, allez comprendre. Je n&rsquo;ai pas poursuivi le test avec GPT 4 car je paie au token.<\/p>\n<p>Mistral 8B me donne une premi\u00e8re version encore moins efficace que celle de Copilot : il recalcule la factorielle pour toutes les valeurs entre 1 et n.<\/p>\n<p>Mais Mistral tourne sur mon PC de pr\u00e8s de 10 ans (un i5-4460 avec 8 GB de m\u00e9moire sans carte graphique suppl\u00e9mentaire), il met environ une minute pour r\u00e9pondre \u00e0 mes questions.<\/p>\n<p>Voil\u00e0, je vous dis \u00e0 bient\u00f4t pour la grande finale qui opposera l&rsquo;humanit\u00e9 (toujours moi) contre l&rsquo;IA (GPT 4) pour un match de math\u00e9matiques (en cat\u00e9gorie plus de 80 kg). Les places sont gratuites.<\/p>\n<p><a href=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.10-A-chess-game-between-a-man-and-an-artificial-intelligence-envisioned-in-the-surrealistic-style-of-Salvador-Dali-characterized-by-dream-like-landscap.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-138951\" src=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.10-A-chess-game-between-a-man-and-an-artificial-intelligence-envisioned-in-the-surrealistic-style-of-Salvador-Dali-characterized-by-dream-like-landscap.webp\" alt=\"\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.10-A-chess-game-between-a-man-and-an-artificial-intelligence-envisioned-in-the-surrealistic-style-of-Salvador-Dali-characterized-by-dream-like-landscap.webp 1024w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.10-A-chess-game-between-a-man-and-an-artificial-intelligence-envisioned-in-the-surrealistic-style-of-Salvador-Dali-characterized-by-dream-like-landscap-300x300.webp 300w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.10-A-chess-game-between-a-man-and-an-artificial-intelligence-envisioned-in-the-surrealistic-style-of-Salvador-Dali-characterized-by-dream-like-landscap-150x150.webp 150w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.10-A-chess-game-between-a-man-and-an-artificial-intelligence-envisioned-in-the-surrealistic-style-of-Salvador-Dali-characterized-by-dream-like-landscap-768x768.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><em>Illustration par DALL\u00b7E (+Salvador Dali) (+PJ) <\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-138950\" src=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a.webp\" alt=\"\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a.webp 1024w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a-300x300.webp 300w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a-150x150.webp 150w, https:\/\/www.pauljorion.com\/blog\/wp-content\/uploads\/DALL\u00b7E-2024-02-22-00.45.26-A-chess-game-between-a-man-and-an-artificial-intelligence-depicted-in-the-style-of-Paul-Gauguin-known-for-his-use-of-bold-colors-strong-outlines-a-768x768.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><em>Illustration par DALL\u00b7E (+Paul Gauguin) (+PJ) <\/em><\/p>\n<p>Comme on parle ici de programmation et qu&rsquo;il y a des participants qui visiblement ont une exp\u00e9rience de la programmation, je leur propose un petit match entre l&rsquo;humanit\u00e9 (repr\u00e9sent\u00e9e par moi, applaudissements) et l&rsquo;IA (repr\u00e9sent\u00e9e par Bing \u00ab\u00a0Copilot\u00a0\u00bb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,16,9489],"tags":[4028,9490,9312,9488,9147,940],"class_list":["post-138949","post","type-post","status-publish","format-standard","hentry","category-intelligence-artificielle","category-mathematiques","category-programmation","tag-algorithmes","tag-code","tag-copilot","tag-factorielle","tag-gpt-4","tag-intelligence-artificielle-2"],"_links":{"self":[{"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/posts\/138949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/comments?post=138949"}],"version-history":[{"count":7,"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/posts\/138949\/revisions"}],"predecessor-version":[{"id":138958,"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/posts\/138949\/revisions\/138958"}],"wp:attachment":[{"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/media?parent=138949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/categories?post=138949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pauljorion.com\/blog\/wp-json\/wp\/v2\/tags?post=138949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}