{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/benchmarking-llama2-mistral-gemma-and-gpt-for","title":"Benchmarking Llama2, Mistral, Gemma and GPT for Factuality, Toxicity, Bias and Propensity for Hallucinations","arxiv_id":"2404.09785","date":"2024-04-15","proceeding":null,"authors":["David Nadeau","Mike Kroutikov","Karen McNeil","Simon Baribeau"],"abstract":"This paper introduces fourteen novel datasets for the evaluation of Large Language Models' safety in the context of enterprise tasks. A method was devised to evaluate a model's safety, as determined by its ability to follow instructions and output factual, unbiased, grounded, and appropriate content. In this research, we used OpenAI GPT as point of comparison since it excels at all levels of safety. On the open-source side, for smaller models, Meta Llama2 performs well at factuality and toxicity but has the highest propensity for hallucination. Mistral hallucinates the least but cannot handle toxicity well. It performs well in a dataset mixing several tasks and safety vectors in a narrow vertical domain. Gemma, the newly introduced open-source model based on Google Gemini, is generally balanced but trailing behind. When engaging in back-and-forth conversation (multi-turn prompts), we find that the safety of open-source models degrades significantly. Aside from OpenAI's GPT, Mistral is the only model that still performed well in multi-turn tests.","url_abs":"https://arxiv.org/abs/2404.09785v1","url_pdf":"https://arxiv.org/pdf/2404.09785v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"benchmarking-llama2-mistral-gemma-and-gpt-for","repo_url":"https://github.com/innodatalabs/innodata-llm-safety","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"benchmarking","task_name":"Benchmarking"},{"task_slug":"bias-detection","task_name":"Bias Detection"},{"task_slug":"dialogue-safety-prediction","task_name":"Dialogue Safety Prediction"},{"task_slug":"hallucination","task_name":"Hallucination"}],"methods":[],"datasets_introduced":[{"slug":"rt-inod-bias","name":"rt-inod-bias","full_name":"Red Teaming Innodata Bias"},{"slug":"rt-inod-finance","name":"rt-inod-finance","full_name":"Red Teaming Innodata Finance"},{"slug":"rt-inod-jailbreaking","name":"rt-inod-jailbreaking","full_name":"Red Teaming Innodata Jailbreaking"}],"methods_introduced":[],"results":[{"leaderboard":"/sota/bias-detection-on-rt-inod-bias","task":"Bias Detection","dataset":"rt-inod-bias","model":"GPT-4","rank_in_archive_order":1,"of":5,"metrics":{"Best-of":"0.5"},"uses_additional_data":false},{"leaderboard":"/sota/bias-detection-on-rt-inod-bias","task":"Bias Detection","dataset":"rt-inod-bias","model":"Gemma","rank_in_archive_order":2,"of":5,"metrics":{"Best-of":"0.41"},"uses_additional_data":false},{"leaderboard":"/sota/bias-detection-on-rt-inod-bias","task":"Bias Detection","dataset":"rt-inod-bias","model":"Baseline","rank_in_archive_order":3,"of":5,"metrics":{"Best-of":"0.41"},"uses_additional_data":false},{"leaderboard":"/sota/bias-detection-on-rt-inod-bias","task":"Bias Detection","dataset":"rt-inod-bias","model":"Mistral","rank_in_archive_order":4,"of":5,"metrics":{"Best-of":"0.36"},"uses_additional_data":false},{"leaderboard":"/sota/bias-detection-on-rt-inod-bias","task":"Bias Detection","dataset":"rt-inod-bias","model":"Llama2","rank_in_archive_order":5,"of":5,"metrics":{"Best-of":"0.34"},"uses_additional_data":false},{"leaderboard":"/sota/dialogue-safety-prediction-on-rt-inod","task":"Dialogue Safety Prediction","dataset":"rt-inod-jailbreaking","model":"Baseline","rank_in_archive_order":1,"of":5,"metrics":{"Best-of":"0.92"},"uses_additional_data":false},{"leaderboard":"/sota/dialogue-safety-prediction-on-rt-inod","task":"Dialogue Safety Prediction","dataset":"rt-inod-jailbreaking","model":"GPT-4","rank_in_archive_order":2,"of":5,"metrics":{"Best-of":"0.91"},"uses_additional_data":false},{"leaderboard":"/sota/dialogue-safety-prediction-on-rt-inod","task":"Dialogue Safety Prediction","dataset":"rt-inod-jailbreaking","model":"Gemma","rank_in_archive_order":3,"of":5,"metrics":{"Best-of":"0.91"},"uses_additional_data":false},{"leaderboard":"/sota/dialogue-safety-prediction-on-rt-inod","task":"Dialogue Safety Prediction","dataset":"rt-inod-jailbreaking","model":"Mistral","rank_in_archive_order":4,"of":5,"metrics":{"Best-of":"0.87"},"uses_additional_data":false},{"leaderboard":"/sota/dialogue-safety-prediction-on-rt-inod","task":"Dialogue Safety Prediction","dataset":"rt-inod-jailbreaking","model":"Llama2","rank_in_archive_order":5,"of":5,"metrics":{"Best-of":"0.86"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.09785","atlas_url":"https://app.syntology.ai/?focus=2404.09785","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.09785"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/innodatalabs/innodata-llm-safety","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":7,"unverified":1},"by_repo_kind":{"official":{"samples":8,"ran":7,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"d588d40022bd695a","entry":"build_coverage_matrix","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/verification.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/verification.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d588d40022bd695a"}},{"code_sha256_prefix":"f6149b7760914f4b","entry":"canonicalize_dataset_name","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/benchmark_utils.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/benchmark_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f6149b7760914f4b"}},{"code_sha256_prefix":"e4c386a84cba8e32","entry":"canonicalize_model_name","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/benchmark_utils.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/benchmark_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e4c386a84cba8e32"}},{"code_sha256_prefix":"474aa0523777da52","entry":"create_backup","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/clean.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/clean.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"474aa0523777da52"}},{"code_sha256_prefix":"3fdbced8ead7865b","entry":"extract_llms_and_datasets","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/verification.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/verification.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3fdbced8ead7865b"}},{"code_sha256_prefix":"68ce2da084a8ce5b","entry":"find_folders_missing_meta","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/benchmark_utils.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/benchmark_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"68ce2da084a8ce5b"}},{"code_sha256_prefix":"fb1d765e46465110","entry":"verify_coverage","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/verification.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/verification.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb1d765e46465110"}},{"code_sha256_prefix":"47b1553cc5bb77ad","entry":"prompt_confirmation","repo":"innodatalabs/innodata-llm-safety","repo_kind":"official","path":"verification_and_cleaning/clean.py","file_url":"https://github.com/innodatalabs/innodata-llm-safety/blob/HEAD/verification_and_cleaning/clean.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"47b1553cc5bb77ad"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}